Today, I discovered that the patch I originally submitted on this mail thread
may fail when Ruby is compiled with aggressive optimization. The attached
updated patch fixes this.
http://www.nabble.com/file/p14450466/thread18.patch thread18.patch
I also found an error in the way I'd been timing the benchmarks
in the original posting. I had been comparing optimized unpatched
Ruby with an unoptimized patched Ruby. Now, with -O2 optimization
for all versions, on my Gentoo Linux 1.5 Ghz Centrino laptop,
I get these results:
Unpatched 1.8.6 Patched 1.8.6
Benchmark #1 22sec / 16 MB 4sec / 7 MB
Benchmark #2 35sec / 10 MB 15sec / 7 MB
If you have an application that creates many threads or
frequency switches between them, I invite you
to try this patch. I expect improvements to be largely
platform and OS independent. It should be a function
of how deep the call stack is when new
threads are created.
- brent
--
View this message in context: http://www.nabble.com/Experimental-PATCH-to-improve-thread-performance-tp14409855p14450466.html
Sent from the ruby-core mailing list archive at Nabble.com.