3 ms·
How quickly can you break a long string into lines?
- pestatije 2y ago> half the speed as that of a memory copy without 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 agoCurious question: would prefilling destination buffer with newlines (\n only) be faster than sprinkling them from a list of positions?
- tomByrer 2y agoI'm grateful that both x86 & ARM CPUs are perf-tested.