You could try with FPC 3.3.1 as there were some fixes regarding the closing of sockets recently (don't know if that is what affects you however).
I do use 3.3.1, updated like 3 days ago or so. Let me update again.
What is the time if you simply read the file with TFileStream (discarding the data, only the raw read time)?
You mean only the
? It's only like 50-70ms.
Curious, which platform did you test on? I just ran your latest version against Go in a Linux x86-64 virtual machine and got a slightly different result:
go: parsed 1739278 stop times in 2.3342127s
fpc: parsed 1739278 stop times in 2.470 seconds
go version: go1.19.3 linux/amd64
fpc version: 3.3.1-12058-g9b6926c5f5 linux x86_64
Same Linux x86_64, but on a real machine, i7-7700HQ, DDR4-2400 dual channel, Sandisk Extreme Portable SSD V2 500GB over USB 3.0.
I've taken a peek at Go implementation, and boy it's
a hell lot more complex than my code, so I'm surprised how good their optimizations work. Or perhaps SetLength() on every iteration is not a good idea, let's see if I can optimize that.
EDIT: Optimized by replacing direct dynamic array with TVector which has quite efficient growth factor, I got additional 250ms.