Matching Regexps 200 Times Faster
Written by
Benoit Daloze @eregontp
on March 14, 2025
TLDR: Regular Expressions can be faster than C code and even hand-written SIMD code.
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 ...
Read more at eregon.me