Charles Oliver Nutter wrote:
This patch appears to be either a little faster or about the same. But I thought I'd throw it out there for others to experiment with.
Actually, it has a much more measurable effect on interpreted mode, probably because DynamicScope is hit more heavily and directly:
without: Control: 100k loops accessing a local variable 100 times 0.954000 0.000000 0.954000 ( 0.953000) 0.800000 0.000000 0.800000 ( 0.800000) 0.768000 0.000000 0.768000 ( 0.768000) 0.763000 0.000000 0.763000 ( 0.763000) 0.763000 0.000000 0.763000 ( 0.763000) 0.771000 0.000000 0.771000 ( 0.771000) 0.767000 0.000000 0.767000 ( 0.767000) 0.759000 0.000000 0.759000 ( 0.759000) 0.771000 0.000000 0.771000 ( 0.771000) 0.764000 0.000000 0.764000 ( 0.764000) Test STI: 100k loops accessing a fixnum var and calling to_i 100 times 1.531000 0.000000 1.531000 ( 1.531000) 1.523000 0.000000 1.523000 ( 1.523000) 1.528000 0.000000 1.528000 ( 1.528000) 1.525000 0.000000 1.525000 ( 1.524000) 1.524000 0.000000 1.524000 ( 1.525000) 1.528000 0.000000 1.528000 ( 1.528000) 1.522000 0.000000 1.522000 ( 1.523000) 1.523000 0.000000 1.523000 ( 1.523000) 1.525000 0.000000 1.525000 ( 1.524000) 1.525000 0.000000 1.525000 ( 1.525000) Test non-STI: 100k loops accessing an Array var and calling to_a 100 times 1.921000 0.000000 1.921000 ( 1.922000) 1.903000 0.000000 1.903000 ( 1.903000) 1.905000 0.000000 1.905000 ( 1.904000) 1.911000 0.000000 1.911000 ( 1.911000) 1.910000 0.000000 1.910000 ( 1.910000) 1.905000 0.000000 1.905000 ( 1.905000) 1.901000 0.000000 1.901000 ( 1.901000) 1.902000 0.000000 1.902000 ( 1.902000) 1.901000 0.000000 1.901000 ( 1.901000) 1.901000 0.000000 1.901000 ( 1.901000) Test interpreted: 100k loops calling self's foo 100 times 3.694000 0.000000 3.694000 ( 3.694000) 3.759000 0.000000 3.759000 ( 3.759000) 3.732000 0.000000 3.732000 ( 3.732000) 3.849000 0.000000 3.849000 ( 3.849000) 3.793000 0.000000 3.793000 ( 3.793000) 3.756000 0.000000 3.756000 ( 3.756000) 3.754000 0.000000 3.754000 ( 3.755000) 3.731000 0.000000 3.731000 ( 3.731000) 3.730000 0.000000 3.730000 ( 3.731000) 3.734000 0.000000 3.734000 ( 3.734000) with: Control: 100k loops accessing a local variable 100 times 0.881000 0.000000 0.881000 ( 0.880000) 0.760000 0.000000 0.760000 ( 0.761000) 0.735000 0.000000 0.735000 ( 0.736000) 0.767000 0.000000 0.767000 ( 0.767000) 0.734000 0.000000 0.734000 ( 0.734000) 0.738000 0.000000 0.738000 ( 0.738000) 0.735000 0.000000 0.735000 ( 0.735000) 0.740000 0.000000 0.740000 ( 0.739000) 0.738000 0.000000 0.738000 ( 0.738000) 0.735000 0.000000 0.735000 ( 0.735000) Test STI: 100k loops accessing a fixnum var and calling to_i 100 times 1.434000 0.000000 1.434000 ( 1.434000) 1.430000 0.000000 1.430000 ( 1.430000) 1.428000 0.000000 1.428000 ( 1.428000) 1.428000 0.000000 1.428000 ( 1.428000) 1.432000 0.000000 1.432000 ( 1.432000) 1.429000 0.000000 1.429000 ( 1.430000) 1.430000 0.000000 1.430000 ( 1.431000) 1.428000 0.000000 1.428000 ( 1.428000) 1.429000 0.000000 1.429000 ( 1.429000) 1.428000 0.000000 1.428000 ( 1.428000) Test non-STI: 100k loops accessing an Array var and calling to_a 100 times 1.858000 0.000000 1.858000 ( 1.859000) 1.840000 0.000000 1.840000 ( 1.840000) 1.839000 0.000000 1.839000 ( 1.839000) 1.846000 0.000000 1.846000 ( 1.846000) 1.839000 0.000000 1.839000 ( 1.840000) 1.841000 0.000000 1.841000 ( 1.840000) 1.841000 0.000000 1.841000 ( 1.841000) 1.838000 0.000000 1.838000 ( 1.838000) 1.839000 0.000000 1.839000 ( 1.839000) 1.839000 0.000000 1.839000 ( 1.839000) Test interpreted: 100k loops calling self's foo 100 times 3.565000 0.000000 3.565000 ( 3.565000) 3.724000 0.000000 3.724000 ( 3.725000) 3.661000 0.000000 3.661000 ( 3.662000) 3.666000 0.000000 3.666000 ( 3.666000) 3.657000 0.000000 3.657000 ( 3.657000) 3.662000 0.000000 3.662000 ( 3.663000) 3.718000 0.000000 3.718000 ( 3.718000) 3.674000 0.000000 3.674000 ( 3.674000) 3.709000 0.000000 3.709000 ( 3.709000) 3.667000 0.000000 3.667000 ( 3.667000) - Charlie --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
