3 ms·
I am happy to be proven wrong. That is something I have not done in Go and is good to know. But I could be wrong on this one, I have no idea how Go buffers are
by throwaway2016a 9y ago
I am happy to be proven wrong.
That is something I have not done in Go and is good to know. But I could be wrong on this one, I have no idea how Go buffers are performance optimized but reading a character from a C array is one CPU instruction... it feels intuitive that in Go just the fact the extra layer of abstraction is added on top means it will be more instructions on the CPU.
But that is just a gut, I have not tested it.
Which in my use case would make a big difference over time.
But my intuition also tells me that it would still max out disk access in Go with modern CPUs.
Edit:
I should mention that my use case was to processes as many gigs of files on as cheap an AWS server as possible while maintaining a very strict SLA on how fast processing should be (the data became obsolete in hours and when we tried higher level languages the data was obsolete before a single file could finish). So I was trying to squeeze out as many CPU cycles as possible.
I should also mention that Go didn't even exist yet in a stable state when I did this project.
- stmw 9y agoThe real issue is the garbage collector, something that neither C nor Rust have. Automatic memory management (or thoughtful manual memory management) is good. Garbage collection is a problem.
- throwaway2016a 9y agoPresumably if the buffer is pre-allocated and there are no other variables in play, the Go garbage collector wouldn't get executed often if at all.
- stmw 9y agoUnfortunately, "presumably" is not good enough for systems programming - you have no idea when it might run, and you might end up with a lot of environment variables attempting to tame its behavior - like the JDK has.