vdash icon indicating copy to clipboard operation
vdash copied to clipboard

Speed up log line parsing

Open RMcTn opened this issue 11 months ago • 4 comments

The source capture group was trying to match beyond the closing square bracket ]. Limiting the search to the first square bracket saves a fair bit of work

The flamegraphs aren't rendering ideally on Github, but very rough numbers from a test against a single 300MB log file on an M1 Mac Pro: Around 64% of samples were taken in the decode_metadata function before the change. Around 45% of samples were taken in the decode_metadata function after the change.

Pre change flamegraph: pre-change 300MB logfile

Post change flamegraph:

post-change 300MB logfile

RMcTn avatar Mar 26 '24 02:03 RMcTn