Why is std.regex slow, well here is one reason!

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Thu Feb 23 20:50:52 UTC 2023


On 24/02/2023 9:26 AM, Walter Bright wrote:
>  > std.regex is triggering decompression and bringing a whole pile of 
> logic that wouldn't be required otherwise
> 
> This is good detective work. At minimum, please file a bugzilla issue 
> with your analysis.

Sounds good, its just not the best idea to do it when you should be 
asleep ;)

> How about making the decompression code lazy?

It should already be lazy. Its just the wrong type of lazy.

Everything about std.uni and its tables is about tradeoffs. It is 
designed to be opt-in and to be small in binary. If you didn't care 
about binary sizes it would be easy enough to have it all in ROM ready 
to go, but it'll be over 8mb if you did that (mine is).

On that note, I recently looked at Unicode symbols for identifiers; we 
can shrink the is alpha LUT in dmd to ~1/9th its current size by 
updating to C11 :)

Unicode keeps growing, which is good for compilers, but horrible for 
standard libraries!


More information about the Digitalmars-d mailing list