diff options
Diffstat (limited to 'lib/MaildirIndexer/Parser.pm6')
-rw-r--r-- | lib/MaildirIndexer/Parser.pm6 | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/MaildirIndexer/Parser.pm6 b/lib/MaildirIndexer/Parser.pm6 index 7780a62..97f0cd9 100644 --- a/lib/MaildirIndexer/Parser.pm6 +++ b/lib/MaildirIndexer/Parser.pm6 @@ -87,10 +87,17 @@ 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 ~= $_; - done if $string ~~ /@separators/; + 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; } } + MaildirIndexer::LogTimelineSchema::Parse::Email::SocketChunk.log(:done); $result = parse-email($string); } return $result; |