ActionsLike0
Feature #15721
openoptimize comparison of special const
Status:
Open
Assignee:
-
Target version:
-
Description
Description¶
optimize comparison between special consts in comparable_by_identity
.
it is called from ==
.
Benchmark¶
num_array = Array.new(1_000_000) { 1 }
num_array.include? nil
# 0.156 => 0.0089 # 20x faster!
num_array.include? :symbol
# 0.157 => 0.0086 # 20x faster!
num_array.include? 'str'
# 0.185 => 0.183 # not faster because 'str' is not a special const
Files
No data to display
ActionsLike0