[ruby-core:118931] [Ruby master Feature#20692] Rewrite Array#bsearch in Ruby
From:
"sebyx07 (Sebastian Buza) via ruby-core" <ruby-core@...>
Date:
2024-08-22 21:20:49 UTC
List:
ruby-core #118931
Issue #20692 has been updated by sebyx07 (Sebastian Buza).
added more optimizations
```
Benchmark results (average over 10000000 iterations):
user system total real
Original bsearch: 12.329160 0.009148 12.338308 ( 12.337310)
Native bsearch: 3.437350 0.000057 3.437407 ( 3.437270)
```
----------------------------------------
Feature #20692: Rewrite Array#bsearch in Ruby
https://bugs.ruby-lang.org/issues/20692#change-109499
* Author: sebyx07 (Sebastian Buza)
* Status: Open
----------------------------------------
inspired by https://bugs.ruby-lang.org/issues/20182
Benchmark results (average over 10000000 iterations):
user system total real
Original bsearch: 7.011691 0.000038 7.011729 ( 7.013117)
Native bsearch: 2.809711 0.001000 2.810711 ( 2.812067)
https://github.com/sebyx07/native_ruby/blob/master/lib/native_ruby/array/bsearch.rb
I also created this gem:
https://github.com/sebyx07/native_ruby/ - to load patches w/o depending on the ruby/master
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/