Closed byroot closed 2 days ago
Java side is implemented atop this PR in #538.
We need some benchmarks!
I cherry picked you commits.
Now TruffleRuby head seem to crash for some reason, but I'm having trouble understanding Truffle crash reports, so I'm going to assume it's just a bug in Truffle. FYI: @eregon
Also the TruffleRuby::Generator
is still buffering everything in a string before flushing, like other implementations used to.
Re the TruffleRuby crash, @andrykonchin can you look at that?
@byroot Thanks! I have some optimizations I'll do in a separate PR now.
@eregon The issue is fixed in https://github.com/oracle/truffleruby/commit/567aa2763b79c54e68615e66d8d4221cadb871d4.
Urk, I didn't realize rb_gc_mark_locations
was using rb_gc_mark_maybe
under the hood. I probably should use a loop instead.
Yes, I've never seen rb_gc_mark_locations()
before, I think a simple loop would be better/safer and as fast or faster.
Ref: https://github.com/ruby/json/issues/524
Fix: https://github.com/ruby/json/pull/538 Fix: https://github.com/ruby/json/issues/524
Rather than to buffer everything in memory.
Unfortunately Ruby doesn't provide an API to write into and IO without first allocating a string, which is a bit wasteful.
FYI: @headius