1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext
Watson 98a9445db9
[flori/json] Add shortcut converting to String
In where to convert Hash key to String for json, this patch will add shortcut for String/Symbol in Hash key.

```
$ ruby bench_json_generate.rb
Warming up --------------------------------------
                json    65.000  i/100ms
Calculating -------------------------------------
                json    659.576  (± 1.5%) i/s -      3.315k in   5.027127s
```

```
$ ruby bench_json_generate.rb
Warming up --------------------------------------
                json    78.000  i/100ms
Calculating -------------------------------------
                json    789.781  (± 2.7%) i/s -      3.978k in   5.041043s
```

```
require 'json'
require 'benchmark/ips'

obj = []

1000.times do |i|
  obj << {
    "id" => i,
    :age => 42,
  }
end

Benchmark.ips do |x|
  x.report "json" do |iter|
    count = 0
    while count < iter
      JSON.generate(obj)
      count += 1
    end
  end
end
```

https://github.com/flori/json/commit/38c0f6dbe4
2019-10-14 19:54:49 +09:00
..
-test- Moved RB_METHOD_DEFINITION_DECL to intern.h 2019-10-12 17:47:28 +09:00
bigdecimal Import changes from ruby/bigdecimal (#2531) 2019-10-08 09:06:28 +09:00
cgi/escape
continuation
coverage Revert https://github.com/ruby/ruby/pull/2486 2019-10-03 12:45:24 +09:00
date
dbm
digest Suppress deprecation warnings of MD5 from Xcode 11.1 2019-10-12 18:47:06 +09:00
etc drop-in type check for rb_define_module_function 2019-08-29 18:34:09 +09:00
fcntl
fiber
fiddle
gdbm
io [ruby/io-console] Defer creating VT query string 2019-09-26 09:59:27 +09:00
json [flori/json] Add shortcut converting to String 2019-10-14 19:54:49 +09:00
nkf
objspace Rename NODE_ARRAY to NODE_LIST to reflect its actual use cases 2019-09-07 13:56:29 +09:00
openssl Prefer rb_gc_register_mark_object 2019-10-10 19:59:21 +09:00
pathname Fix more keyword argument separation issues in Pathname 2019-09-26 08:01:53 -07:00
psych ext/psych/yaml/api.c: Suppress a "variable set but not used" warning 2019-08-24 20:31:16 +09:00
pty rb_ensure now free from ANYARGS 2019-08-27 15:52:26 +09:00
racc/cparse rb_catch now free from ANYARGS 2019-08-27 15:52:26 +09:00
rbconfig/sizeof
readline drop-in type check for rb_define_singleton_method 2019-08-29 18:34:09 +09:00
ripper Changed numbered parameter prefix 2019-09-24 21:57:54 +09:00
rubyvm
sdbm
socket Support timeout for Addrinfo 2019-09-10 10:10:59 +09:00
stringio [ruby/stringio] Bump up the version 2019-09-29 18:55:34 +09:00
strscan Fixed overflow at onig_region_set 2019-10-14 15:10:56 +09:00
syslog ext/syslog/extconf.rb: add -llog for Android 2019-10-10 23:21:24 +09:00
win32
win32ole
zlib [ruby/zlib] Fix for older ruby 2.6 or earlier 2019-09-29 18:53:11 +09:00
.document
extmk.rb Revert "DEBUG: dump mkmf.log" 2019-09-19 20:57:57 +09:00
Setup
Setup.atheos
Setup.nt