[#92063] [Ruby trunk Misc#15723] Reconsider numbered parameters — zverok.offline@...
Issue #15723 has been updated by zverok (Victor Shepelev).
3 messages
2019/03/31
[ruby-core:91921] [Ruby trunk Feature#15721] optimize comparison of special const
From:
masaki@...
Date:
2019-03-22 06:25:07 UTC
List:
ruby-core #91921
Issue #15721 has been reported by masarakki (masaki yamada).
----------------------------------------
Feature #15721: optimize comparison of special const
https://bugs.ruby-lang.org/issues/15721
* Author: masarakki (masaki yamada)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
## Description
optimize comparison between special consts in `comparable_by_identity`.
it is called from `==` .
## Benchmark
```ruby
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--------------------------------
optimize-comparable-condition.patch (1.49 KB)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>