4 ms·
It’s hard to beat Perl when it comes to string matching performance and flexibility.
by CoolGuySteve 5y ago
It’s hard to beat Perl when it comes to string matching performance and flexibility.
- moralestapia 5y agoActually, no. But it's some sort of technical heritage/baggage.
- vlovich123 5y agoI actually dug into it, & it's not clear. Rust & many C libraries do outperform Perl if you can stick to an NFA regex. If you like backtracking & lookaround, then it's not clear that Perl loses that much in performance. The language itself is definitely better suited to writing those regexes all over the place, so if you have two axes of performance & regex usability, I wouldn't discount Perl for those use-cases. I do suspect though that the bioinformatics field overindexes its use of Perl because that's what they know even though it's less well-suited for other things. That being said, that's usually why programmers might choose Python. Something to be said for familiarity & access to a thriving software ecosystem you're familiar with.
- moralestapia 5y agoI actually programmed it, for that exact scenario, and there's some really nice C++ libraries that outperform Perl, even in the cases you mentioned. Sure, Perl it's easier, but not necessarily faster. You can downvote this comment as well, code is code at the end of the day :^)
- vlovich123 5y agoI’m not downvoting you. I shared your prior but I couldn’t find any benchmarks showing it in a fair comparison. Now of course it’s entirely possible that bioinformatics applications don’t really need Perl features in most applications so they would benefit from something else. Rust also has fancy regex crate that has an advanced fused implementation to detect when it can use the faster form automatically. But I haven’t found any benchmarks definitively showing other implementations beating Perl in use cases it’s optimized for (complex backtracking and lookaround).