forked from ohler55/oj
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch uses standard C library to copy the string. (Ref. ohler55#674) − | before | after | result -- | -- | -- | -- Oj.dump | 1.046M | 1.102M | 1.054x ### Environment - Zorin OS 16 - AMD Ryzen 7 5700G - gcc version 11.1.0 - Ruby 3.1.0 ### Before ``` Warming up -------------------------------------- Oj.dump 106.035k i/100ms Calculating ------------------------------------- Oj.dump 1.046M (± 1.0%) i/s - 15.799M in 15.098842s ``` ### After ``` Warming up -------------------------------------- Oj.dump 112.786k i/100ms Calculating ------------------------------------- Oj.dump 1.102M (± 1.1%) i/s - 16.580M in 15.051956s ``` ### Test code ```ruby require 'benchmark/ips' require 'oj' data = { float: 3.141592653589793, fixnum: 2 ** 60 } Benchmark.ips do |x| x.time = 15 x.report('Oj.dump') { Oj.dump(data, mode: :compat) } end ```
- Loading branch information
1 parent
34dce22
commit b4c0fe1
Showing
3 changed files
with
14 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters