From: Paul Brannan Date: 2008-10-08T00:08:12+09:00 Subject: [ruby-core:19171] [Feature #619] improved performance of BASIC_OP_UNREDEFINED_P Feature #619: improved performance of BASIC_OP_UNREDEFINED_P http://redmine.ruby-lang.org/issues/show/619 Author: Paul Brannan Status: Open, Priority: Normal Category: core ruby_vm_redefined_flag uses bit arithmetic to manage which flags have been redefined. Performance can be improved by using a separate word for each redefined operation. In 100 runs user time was improved 1.4% at the 95th percentile: require 'benchmark' Percentile Before After 50 7.60 7.52 90 7.73 7.63 95 7.76 7.65 98 7.92 7.69 99 8.06 7.73 Performance numbers at the 98th percentile and above likely includes outliers. Test was run on a dual Xeon 3.06GHz. Test script: N = 10_000_000 Benchmark.bm { |x| x.report do for i in 1..N do 1+1 end end } ---------------------------------------- http://redmine.ruby-lang.org