diff options
author | dakkar <dakkar@thenautilus.net> | 2019-12-27 17:38:06 +0000 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2019-12-27 17:38:06 +0000 |
commit | 3cb6d151f9f7ab86c29a5f79c69cbdab8e99dbb3 (patch) | |
tree | cf567f2757f69ce982c9f76496ab7f8fcba1f992 /lib/MaildirIndexer/Parser.pm6 | |
parent | Log::Timeline (diff) | |
download | MaildirIndexer-3cb6d151f9f7ab86c29a5f79c69cbdab8e99dbb3.tar.gz MaildirIndexer-3cb6d151f9f7ab86c29a5f79c69cbdab8e99dbb3.tar.bz2 MaildirIndexer-3cb6d151f9f7ab86c29a5f79c69cbdab8e99dbb3.zip |
ok, the slow bit is looking for the @separators
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; |