From: dmertz@... (denis) Date: 2004-05-25T21:03:42+09:00 Subject: Re: make faster Richards benchmark Nice that we are now faster than python, but there is still room for small improvements. You can find my version here: http://flwrpwr.free.fr/Ruby/bench/bench27.rb It is based on version #26 of the ruby OO bench, with the following changes: * precompile the isHeldOrSuspended? expression (this gives the largest speed gain) * use @state |= x instead of @state = @state | x (it is slightly faster) * remove unneeded temporary variables and unused return values * rewrite some conditionals in a more rubyish way (and more efficient) * make better use of conditionals return value (eg like in Tcb.run) * use symbols to represent packet kind. (this is more a style change, speed is unchanged) * in WorkerTask.run, use collect! to change the content of packet.a2 The speed gain between my version and #26 is approximatelly the same as between #26 and #25. Bye bye Denis