[#3986] Re: Principle of least effort -- another Ruby virtue. — Andrew Hunt <andy@...>

> Principle of Least Effort.

14 messages 2000/07/14

[#4043] What are you using Ruby for? — Dave Thomas <Dave@...>

16 messages 2000/07/16

[#4139] Facilitating Ruby self-propagation with the rig-it autopolymorph application. — Conrad Schneiker <schneik@...>

Hi,

11 messages 2000/07/20

[ruby-talk:03843] A performance improvement!

From: Dave Thomas <Dave@...>
Date: 2000-07-05 17:35:08 UTC
List: ruby-talk #3843
I've been working on performance testing, and I came across a strange
situation. In my tests,

     str.gsub!(/[abc]/, '')

ran slower than

     str.gsub!(/a/, '')
     str.gsub!(/b/, '')
     str.gsub!(/c/, '')

Matz ran the same tests, and got opposite results.

The difference between our two systems was the version of gcc. I was
running egcs 2.91, and he was running gcc 2.95.2.

So, I upgraded my compiler, and lo! my test timings changed
dramatically.

                 Old           New

     Test1     1.339         0.647

     Test2     0.671         0.259


So, a compiler upgrade gave me a factor of 2 performance improvement
with code than contains character classes.

Just thought I'd pass that on.


Regards


Dave

In This Thread

Prev Next