Hey there,
The compilation is done in the function instead of at the module level.
As such, it defeats the purpose of the compilation because it'll be executed every single call.
By putting it at the module level (before the function declaration as in the original unijson package), the compilation is executed only once at import time and the regex can be executed fast after that.
Kind regards,
Bastien