diff options
| author | eno <eno@open-lab.org> | 2025-03-16 19:51:59 +0100 |
|---|---|---|
| committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2025-03-27 11:37:27 +0900 |
| commit | d1f3c8125854bb0976b08dbcbda3524d8ea3e3fe (patch) | |
| tree | fdf4db80041bac1b6483f71adc240b695d309635 /spec/ruby/core/array/first_spec.rb | |
| parent | dc6ffbbe9ec09c9786b67fb5a9427e5a963980a2 (diff) | |
Faster integer formatting
This commit provides an alternative implementation for a
long → decimal conversion.
The main difference is that it uses an algorithm pulled from
https://github.com/jeaiii/itoa.
The source there is C++, it was converted by hand to C for
inclusion with this gem.
jeaiii's algorithm is covered by the MIT License, see source code.
On addition this version now also generates the string directly into
the fbuffer, foregoing the need to run a separate memory copy.
As a result, I see a speedup of 32% on Apple Silicon M1 for an
integer set of benchmarks.
Diffstat (limited to 'spec/ruby/core/array/first_spec.rb')
0 files changed, 0 insertions, 0 deletions
