There's more than one way to do things | |
PerlMonks |
Re: Recommendations for efficient data reduction/substitution applicationby LanX (Saint) |
on Mar 05, 2015 at 11:33 UTC ( [id://1118876]=note: print w/replies, xml ) | Need Help?? |
I solved a roughly similar problem using the trie optimization of the regex engine. You need to put the different match clause into a long or-chain. The replace-part has to identify which regex matched. Further more you should benchmark how expensive replacements are on longer chunks. A sliding window technique could be the answer. Hmm... Could you identify where the bottleneck really is by benchmarking match and replace independently?
In Section
Seekers of Perl Wisdom
|
|