Actually, I think I have the major performance problem figured out
String concatenation. The result << line is the major time sucker
in this. On my laptop when I change RubyString to use a
StringBuffer instead of String a 10,000 line file takes
0.6 seconds to run while it takes 242 seconds
Ok, next point of interest, regexp substitions with String.sub
With my former optimizations for Regexps I got this:
D:\Project\jruby>ruby testRegSubPerformance.rb
Time1 0.581
Time2 0.58
D:\Project\jruby>bin\jruby testRegSubPerformance.rb
Time1 8.623
Time2 5.428
where the test is more or less simi
Ok, the second approach gave a little bit more:
D:\Project\jruby>bin\jruby testRegexpPerformance.rb
Time1 5.168 for sum 15
Time2 3.9453 for sum 15
But it's still not great. Anyway, I've attached the patch if this is
something we should continue work on.
Regards
Ola Bini
---
Once again, a very small test where I replaced the Pattern.compile in
RegexpTranslator into a getPattern which saves all earlier patterns in a
hashmap. This actually worsens the performance slightly, so that's
probably not the right way to go. I will try to apply this approach to
the whole RegexpTr
Hi there,
I made a highly unscientific test of performance of regexps in Ruby
compared to JRuby.
The attached script is what I used to test this. The output is as
follows for 100 000 repetitions of the same regexp applying:
D:\Project\jruby>ruby testRegexpPerformance.rb
Time1 0.201 for sum 15
Hi,
I know that Thom and Charles are going, is there any more people from
the list that's going to show up? My group here in Sweden bought tickets
yesterday.
Regards
Ola Bini
---
This SF.Net email is sponsored by xPML, a groundbreaking script