[–] pestatije 2y ago ↗ > half the speed as that of a memory copywithout going into much deep analysis, id try writing the newlines in a different loop: you are hitting the cache(and memory) in a different way when memcopying and when writing directly. [–] yetihehe 2y ago ↗ Curious question: would prefilling destination buffer with newlines (\n only) be faster than sprinkling them from a list of positions?
[–] yetihehe 2y ago ↗ Curious question: would prefilling destination buffer with newlines (\n only) be faster than sprinkling them from a list of positions?
3 comments
[ 3.6 ms ] story [ 23.9 ms ] threadwithout going into much deep analysis, id try writing the newlines in a different loop: you are hitting the cache(and memory) in a different way when memcopying and when writing directly.