diff options
author | Eric Wong <e@yhbt.net> | 2020-05-09 08:27:37 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-05-09 20:27:36 +0000 |
commit | e07a58aa1a1118b2aeb75e674c3542ae5d93b2c9 (patch) | |
tree | 0cb0fe203cea8392d521349192fc21f3eda7e608 /lib/PublicInbox/EmlContentFoo.pm | |
parent | 1e64f2f0450477ffbb95b887511bdeec28e30ab0 (diff) | |
download | public-inbox-e07a58aa1a1118b2aeb75e674c3542ae5d93b2c9.tar.gz |
Emails a *nix MTA are typically LF-only, so we don't need the complexity of the RE engine when a simple index() works. We still need to ensure there's no "\r\n\r\n" before the first "\n\n", but two calls to index() is still faster than a RE match. This gives a 2-5% speedup in some informal tests and saves ~30MB when scanning a 30MB spam message on newer versions of Perl. I'll have to diagnose why Perl wastes so much memory doing RE matches on giant strings, though.
Diffstat (limited to 'lib/PublicInbox/EmlContentFoo.pm')
0 files changed, 0 insertions, 0 deletions