3 ms·
They are more powerful and expressive, but are also less efficient and significantly slower for simple things like starts/ends_with(). Benchmark index("abc","a
by tyingq 5y ago
They are more powerful and expressive, but are also less efficient and significantly slower for simple things like starts/ends_with().
Benchmark index("abc","ab")==0 vs "abc" =~ /^ab/
- deleted 5y ago[deleted]
- wazoox 5y agoThis is a canonical case of premature optimisation. I have performance problems with the database backend, the network, disk access, but too slow a regex is a completely non-existing problem in real-life for me. Or else I wouldn't be using Perl/PHP/Python/Ruby but C/C++/Rust/Java etc.
- tyingq 5y agoMaybe. Batch processing huge text files is pretty common in Perl.