ruby/ext
Jean Boussier 59eebeca02 [ruby/json] Allocate the initial generator buffer on the stack
Ref: https://github.com/ruby/json/issues/655
Followup: https://github.com/ruby/json/issues/657

Assuming the generator might be used for fairly small documents
we can start with a reasonable buffer size of the stack, and if
we outgrow it, we can spill on the heap.

In a way this is optimizing for micro-benchmarks, but there are
valid use case for fiarly small JSON document in actual real world
scenarios, so trashing the GC less in such case make sense.

Before:

```
ruby 3.3.4 (2024-07-09 revision be1089c8ec) +YJIT [arm64-darwin23]
Warming up --------------------------------------
                  Oj   518.700k i/100ms
          JSON reuse   483.370k i/100ms
Calculating -------------------------------------
                  Oj      5.722M (± 1.8%) i/s  (174.76 ns/i) -     29.047M in   5.077823s
          JSON reuse      5.278M (± 1.5%) i/s  (189.46 ns/i) -     26.585M in   5.038172s

Comparison:
                  Oj:  5722283.8 i/s
          JSON reuse:  5278061.7 i/s - 1.08x  slower
```

After:

```
ruby 3.3.4 (2024-07-09 revision be1089c8ec) +YJIT [arm64-darwin23]
Warming up --------------------------------------
                  Oj   517.837k i/100ms
          JSON reuse   548.871k i/100ms
Calculating -------------------------------------
                  Oj      5.693M (± 1.6%) i/s  (175.65 ns/i) -     28.481M in   5.004056s
          JSON reuse      5.855M (± 1.2%) i/s  (170.80 ns/i) -     29.639M in   5.063004s

Comparison:
                  Oj:  5692985.6 i/s
          JSON reuse:  5854857.9 i/s - 1.03x  faster
```

fe607f4806
2024-11-01 13:04:24 +09:00
..
-test- Cast via uintptr_t function pointer between object pointer 2024-10-10 11:29:57 +09:00
cgi/escape ruby tool/update-deps --fix 2024-04-27 21:55:28 +09:00
continuation ruby tool/update-deps --fix 2024-04-27 21:55:28 +09:00
coverage ruby tool/update-deps --fix 2024-04-27 21:55:28 +09:00
date Resize arrays in rb_ary_freeze and use it for freezing arrays 2024-07-02 10:34:23 -07:00
digest [ruby/digest] Cast via uintptr_t function pointer between object pointer 2024-10-10 14:45:49 +00:00
erb/escape [ruby/erb] Skip building a native extension for JRuby 2024-01-04 22:33:16 +00:00
etc [ruby/etc] Fix sysconfdir when load-relative 2024-10-17 07:32:38 +00:00
fcntl ruby tool/update-deps --fix 2024-04-27 21:55:28 +09:00
fiddle Bump version 2024-10-26 18:44:15 +09:00
io [ruby/io-console] Fix mixing declarations and code for older versions 2024-09-01 03:46:44 +00:00
json [ruby/json] Allocate the initial generator buffer on the stack 2024-11-01 13:04:24 +09:00
monitor ruby tool/update-deps --fix 2024-04-27 21:55:28 +09:00
objspace [Feature #20470] Split GC into gc_impl.c 2024-07-03 09:03:40 -04:00
openssl [ruby/openssl] pkcs7: remove default cipher from PKCS7.encrypt 2024-10-31 08:31:16 +00:00
pathname Allow method chaining with Pathname#mkpath 2024-10-04 12:21:27 +09:00
psych [ruby/psych] Use String#match? over String#=~ when applicable 2024-09-24 19:25:40 +00:00
pty [DOC] Fix typos 2024-10-31 12:44:50 +09:00
rbconfig/sizeof ruby tool/update-deps --fix 2024-04-27 21:55:28 +09:00
ripper Fix memory leak in Ripper for indented heredocs 2024-09-25 08:56:14 -04:00
rubyvm
socket [DOC] Improve Socket::tcp with Happy Eyeballs Version 2 2024-10-20 19:26:01 +09:00
stringio [ruby/stringio] An empty string should be converted to empty in any encoding 2024-10-26 13:20:34 +00:00
strscan [ruby/strscan] [CRuby] Optimize strscan_do_scan(): Remove 2024-10-26 18:44:15 +09:00
win32 [ruby/win32-registry] Exclude rake files from packages [ci skip] 2024-10-17 03:09:32 +00:00
win32ole [ruby/win32ole] win32ole.c: repeated code 2024-07-12 09:45:06 +00:00
zlib [ruby/zlib] Reduce ensure nesting 2024-10-24 10:30:37 +00:00
.document [ruby/io-console] [DOC] Split .document files to sync with ruby/ruby 2023-10-22 11:09:06 +09:00
extmk.rb extmk.rb: define Gem.target_rbconfig not to break Gem::Platform.local 2024-06-18 11:12:52 +09:00
Setup Clean up removed directories in ext/Setup* [ci skip] 2023-01-18 12:02:27 +09:00
Setup.atheos racc/cparse is extracted from ruby/ruby repository 2023-06-08 18:05:07 +09:00
Setup.nt racc/cparse is extracted from ruby/ruby repository 2023-06-08 18:05:07 +09:00