I recently became the maintainer of the json gem, focusing on improving its performance to make it the fastest JSON parser and generator for Ruby. I made simple optimizations driven by profiling, showing that they are generic and could apply to more than just C code. My goal was not solely better performance, as the speed difference between json and oj wasn’t significant in most cases. Despite oj’s popularity due to speed, it has caused numerous issues, like security vulnerabilities and stability problems. Collaborating with another Ruby committer, we optimized ruby/json by reducing setup costs and eliminating unnecessary calls, resulting in significant performance improvements.
https://byroot.github.io/ruby/json/2024/12/15/optimizing-ruby-json-part-1.html