diff options
Diffstat (limited to 'lib/MaildirIndexer/Parser.pm6')
-rw-r--r-- | lib/MaildirIndexer/Parser.pm6 | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/MaildirIndexer/Parser.pm6 b/lib/MaildirIndexer/Parser.pm6 index 97f0cd9..c3586fb 100644 --- a/lib/MaildirIndexer/Parser.pm6 +++ b/lib/MaildirIndexer/Parser.pm6 @@ -87,18 +87,13 @@ multi parse-email(IO::Socket::Async:D $s --> MaildirIndexer::Email) is export { my $string; react { whenever $s.Supply(:enc<utf8-c8>) { - MaildirIndexer::LogTimelineSchema::Parse::Email::SocketChunk.log(:start); $string ~= $_; - MaildirIndexer::LogTimelineSchema::Parse::Email::SocketChunk.log(:appended); - # this is horribly slow?? 1.2 seconds for 18k of text? - # parsing the whole email takes 0.01 seconds! - my $done = $string ~~ /@separators/; - MaildirIndexer::LogTimelineSchema::Parse::Email::SocketChunk.log(:done(so $done)); - done if $done; + # parsing the whole email is much faster (0.02 seconds + # instead of 1.2!) than just C<< $string ~~ + # /@separators/ >> + $result = parse-email($string) and done; } } - MaildirIndexer::LogTimelineSchema::Parse::Email::SocketChunk.log(:done); - $result = parse-email($string); } return $result; } |