In previous post I promised to Improve speed of dynamic call lookups, this is because the speed optimization used to depend heavly on the possibility of inlining and therefore on the type information found at build-time. When no type information for method call receivers can be obtained at build-time, the method call is encoded as dynamic, and the method used to resolve dynamic calls so far was not optimal leading to results significantly worst than MRI 1.9
For example, the next code run faster because of the type information provided by lvar_type directive
class Y def bar(x) i = 1000000 lvar_type(i,Fixnum) ret = 0 while i > 0 ret = x.foo(i,i) i = i - 1 end return ret end end
Else, removing lvar_type:
class Y def bar(x) i = 1000000 #removed lvar_type ret = 0 while i > 0 ret = x.foo(i,i) i = i - 1 end return ret end end
Will result on this (for version without lvar_type):
Before (v0.0.21 and prior)
NOTE: When lvar_type is used, the results are the same as in v0.0.21 (see this post)
Next
Improve speed of dynamic call lookups (not direct or inlined calls)- Inline of inherited methods and potential inline (when a new method is defined methods calling it will be recompiled in order to inline)
- Parallel build of methods