Can I speed up this log parsing script further?

uncorroded via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jun 9 03:01:48 PDT 2017


On Friday, 9 June 2017 at 08:58:38 UTC, Daniel Kozak wrote:

>> There is no difference in speed because you do not process 
>> your data
> lazily, so you make many allocations, so this is main reason 
> why it is so slow. I could improve that, but I will need to see 
> some example data, which you are trying to parse.
>
> But some rules,
> 1.) instead of ~= you shoud use std.array.appender
> 2.) instead of std.string.split you could use 
> std.algorithm.splitter or
> std.algorithm.findSplit
> 3.) instead of indexOf I would use std.algorithm.startsWith (in 
> case it is
> on the begining of the line)

Thanks everyone for the tips.
The log file itself is 52 MB but I have added a sample in 
pastebin ( https://pastebin.com/vj778PK4 ). Will try the 
suggestions today evening.


More information about the Digitalmars-d-learn mailing list