summaryrefslogtreecommitdiff
path: root/data/example.json
diff options
context:
space:
mode:
authorWatson <watson1978@gmail.com>2018-03-04 23:34:26 +0900
committerFlorian Frank <flori@ping.de>2019-04-29 15:58:28 +0200
commit91a24ecac3d722bc3e545fdd0657ed225e91c2df (patch)
treeccdf1f39349676be10c3f6d88f3c50e10df6a1a5 /data/example.json
parentc34d01ff6a18dac04a90b2e0f820cdb1d5c7e1b2 (diff)
downloadjson-91a24ecac3d722bc3e545fdd0657ed225e91c2df.tar.gz
Does not check whether illegal utf-8 if string has ascii only.
## Before ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 25.000 i/100ms Calculating ------------------------------------- json 250.478 (± 4.8%) i/s - 1.250k in 5.002238s ``` ## After ``` $ ruby bench_json_generate.rb Warming up -------------------------------------- json 32.000 i/100ms Calculating ------------------------------------- json 360.652 (± 3.6%) i/s - 1.824k in 5.064511s ``` ## Test code ``` require 'json' require 'benchmark/ips' obj = [] 1000.times do |i| obj << { :string => "x" * 100, :utf8 => "あ" * 100 } end Benchmark.ips do |x| x.report "json" do |iter| count = 0 while count < iter JSON.generate(obj) count += 1 end end end ```
Diffstat (limited to 'data/example.json')
0 files changed, 0 insertions, 0 deletions