3 ms·
The memory cost of these abstractions is staggering. Runtine seems ok, though. What does that teach us?
by choeger 8y ago
The memory cost of these abstractions is staggering. Runtine seems ok, though. What does that teach us?
- dpark 8y agoWhat it teaches us is that looking at allocated memory is the wrong way to go. Peak working set was reduced by only 4MB from V1 to V11. The speed difference from V1 to V11 is <2 seconds and from V2 to V11 it's only 140ms. It's not clear that rewriting the entire program without the benefit of Int and Decimal parsing, without StreamReader, etc. is at all a net gain. ~60 lines of code ballooned to probably a few hundred. Obvious code was replaced with much more complex code that is far more likely to contain latent bugs. All this provided no significant improvement in working set or speed. All it did was avoid gen-0 GC, which is very clearly not a significant bottleneck here. Gen-0 GC essentially is an ArrayPool. It's extremely cheap to free data here.