top | item 42449560

(no title)

bornelsewhere | 1 year ago

Does ruby json use intrinsics? Could it?

Also, how does this play with the various JITs?

discuss

order

byroot|1 year ago

Not too sure what you mean by intrinsincs.

The `json` gem is implemented in C, so it's a black box for YJIT (the reference implementation's JIT).

The TruffleRuby JIT used to interpret C extensions with sulong so it could JIT across languages barrier, but AFAIK they recently stopped doing that because of various compatibility issues.

Also on TruffleRuby the JSON parser is implemented in C, but the encoder is in pure Ruby [0]

[0] https://github.com/ruby/json/blob/e1f6456499d497f33f69ae4c1a...

bornelsewhere|1 year ago

Thanks!

Sorry about misuse of “intrinsics”. There is a simdjson library that uses SIMD instructions for speed. Would such an approach be feasible in the ruby json library?