crystalizer icon indicating copy to clipboard operation
crystalizer copied to clipboard

inline math

Open rdp opened this issue 15 years ago • 1 comments

Currently in the cache_call plugin, if it runs into a > b

it will do a call cached_call_lookup_and_run(a, ">", b)

I'd imagine that "if the method is a math-looking one" then you could add an if statement like...

if TYPE(a) == T_FIXNUM && TYPE(b) == T_FIXNUM RCHECK(FIX2LONG(a) > FIX2LONG(b)) else

do the method call

end

in the c code for cache_call.

This might speed up ridiculous benchmarks like "tak"

rdp avatar Jan 19 '10 19:01 rdp

There are also faster check macros for fixnums and nil.

FIXNUM_P(obj)

rdp avatar Jan 19 '10 19:01 rdp