Ruby takes 2min to match a regex
gist.github.com
Ruby takes 2min to match a regex
1–9 of 9 posts
Re: Ruby takes 2min to match a regex
#2Re: Ruby takes 2min to match a regex
#3Ruby is slow. Dynamic languages often are.
Re: Ruby takes 2min to match a regex
#4if you are using Ruby for any performance sensitive task, you are doing it wrong. Really. Even the die hard fans acknowledge they use it for the meta-magic-shiny-shiny rather than something that complete a given task in a reasonable timeframe. Ruby is slow. Dynamic languages often are.
Re: Ruby takes 2min to match a regex
#5if you are using Ruby for any performance sensitive task, you are doing it wrong. Really. Even the die hard fans acknowledge they use it for the meta-magic-shiny-shiny rather than something that complete a given task in a reasonable timeframe. Ruby is slow. Dynamic languages often are.
I'm not sure that explains the difference between PHP (for example) and Ruby using the same regex.
PHP: 0.07s
Ruby: 114.95s
Java: 0.75s (I expect the majority of this is once off startup time rather than java being slower than PHP once it's "up".)
Dynamic Languages are slow.. But that? That's something completely broken.
Whether or not it's ruby, his build of ruby, a hoax, or something totally unrelated to Ruby that's causing this 1600x slowdown is up for debate though..
Re: Ruby takes 2min to match a regex
#6if you are using Ruby for any performance sensitive task, you are doing it wrong. Really. Even the die hard fans acknowledge they use it for the meta-magic-shiny-shiny rather than something that complete a given task in a reasonable timeframe. Ruby is slow. Dynamic languages often are.
I love ruby but this is bizarre. This example should not take that long.
Re: Ruby takes 2min to match a regex
#7if you are using Ruby for any performance sensitive task, you are doing it wrong. Really. Even the die hard fans acknowledge they use it for the meta-magic-shiny-shiny rather than something that complete a given task in a reasonable timeframe. Ruby is slow. Dynamic languages often are.
notice that PHP and Java were tested as well and had totally reasonable times. The thing to notice here is that there is something about the Ruby regex engine that doesn't properly handle the regex used in the test.
you shouldn't just paint broad-strokes "dynamic languages are often slow". please try to notice what is actually going on here.
Re: Ruby takes 2min to match a regex
#8IIRC this was a pathological case with perl5.0 regexes as well.
Removing one of the redundant * or marking the grouping to be non-capturing with ?: seems to fix the problem.
Looks like the regex optimizer could use some love.
Re: Ruby takes 2min to match a regex
#9if you are using Ruby for any performance sensitive task, you are doing it wrong. Really. Even the die hard fans acknowledge they use it for the meta-magic-shiny-shiny rather than something that complete a given task in a reasonable timeframe. Ruby is slow. Dynamic languages often are.
> Ruby is slow. Dynamic languages often are. I'm not sure that explains the difference between PHP (for example) and Ruby using the same regex. PHP: 0.07s Ruby: 114.95s Java: 0.75s (I expect the majority of this is once off startup time rather than java being slower than PHP once it's "up".) Dynamic Languages are slow.. But that? That's something completely broken. Whether or not it's ruby, his build of ruby, a hoax,…
compute.this.regex.now()
haha! how cool is that! it's like I'm talking with the computer LOL programming is so much fun when you don't have to use those "old languages"