Matching Regexps 200 Times Faster · On the Edge of Ruby
15-Mar-2025 82
You might have seen @byroot’s excellent blog post series on optimizing the json gem. From the first blog post it’s clear most of the time for generating JSON is spent in generate_json_string() and specifically in convert_UTF8_to_JSON(), i.e., in converting Ruby Strings to JSON Strings.
Because this is such a hot part of JSON generation, it has received a lot of attention. In part 3 @byroot shows a lookup table approach to implement convert_UTF8_to_JSON(), which is now used in the json gem.
Matching Regexps 200 Times Faster · On the Edge of Ruby #ruby #rubydeveloper #rubyonrails #Matching #Regexps #Times #Faster https://rubyonrails.ba/link/matching-regexps-200-times-faster-on-the-edge-of-ruby