This regex is so slow that you don't need a timer to see the impact (at
least not on my machine with chicken 4.8.0):

 (string-match "[a-z][a-z0-9\\-_.]{0,20}" "a012345678901234567890123456789")

Changing the {0,20} to + makes it run normally fast so I just replaced the
regex with a string-length and modified the "{0,20}" to "+" . I don't
necessarily need a fix for this but it seems like a possible symptom of a
deeper problem so I thought I'd report it.

Pre-compiling the regex didn't seem to make any difference. Just for
completeness I compared with Ruby and the ruby equivalent is (in human
terms) instant.

"a012345678901234567890123456789".match(/[a-z][a-z0-9]{0,20}/)

-- 
Matt
-=-
90% of the nations wealth is held by 2% of the people. Bummer to be in the
majority...
_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to