|
|
|
|
|
by namkt
1300 days ago
|
|
I would have thought that allocations in managed languages like Go/Python would have been the "fast" part of the processing. Isn't technically the GC that's slowing you down, and not the allocation per se? For one-shot input/output programs like these I guess you could tune the GC to kick in with less frequency. You also note that reading a file sequentially from disk is very fast, which it is, but there is no guarantee that the file's contents are actually sequential on disk (fragmentation), right? We'd have to see how the file was written, and I guess at worst you'd be reading sequential chunks of a hand-wavy 4KB or something depending on the file system and what not. I'm sure others can fill in the details. Just nit-picking here. |
|
However one thing I found out a few years ago is that old data can be slow to read as a lot of error correction kicks in. Additionally a lot of fragmentation at the operating system level in Windows has quite a bit of overhead. It can seriously degrade performance to about 50MB/s sequential reads. In practice defragmentation/rewriting of certain high write files may be necessary on SSDs because Windows read performance degrades at high levels of fragmentation.