You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MRI adopts "jump table"-like optimization for case-when statement if all clauses have trivial immediate values such as Integer and Symbol. How about implementing this optimization in Rubinius?
100000.times do
case 1000
when 0
when 1
when 2
...
when 999
end
end
$ time ruby -v t.rb
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
real 0m0.082s
user 0m0.068s
sys 0m0.012s
# time ruby -v t.rb
rubinius 3.14 (2.2.2 a7ba16db 2016-01-28 3.4.2 JI) [x86_64-linux-gnu]
real 0m2.311s
user 0m2.240s
sys 0m0.064s
(I'm using rubinius/docker.)
Thank you for your consideration,
The text was updated successfully, but these errors were encountered:
Original issue: rubinius/rubinius#3620
Copied here for ease of reading:
Hello,
MRI adopts "jump table"-like optimization for case-when statement if all clauses have trivial immediate values such as Integer and Symbol. How about implementing this optimization in Rubinius?
(I'm using rubinius/docker.)
Thank you for your consideration,
The text was updated successfully, but these errors were encountered: