4 ms·
Is there a bug with write_to_memory.py? (SPOILER BELOW) loop.py does 68 million operations per second, and the text below says "we know about the most we can e
by mieubrisse 3y ago
Is there a bug with write_to_memory.py? (SPOILER BELOW)
loop.py does 68 million operations per second, and the text below says "we know about the most we can expect from Python (100 million things/s)", but write_to_memory.py writes 2 billion bytes per second writing one byte at a time.
How can writing to memory be faster than doing nothing?
- rsfern 3y agoI wasn’t sure what the units were on that one, since the chunk size is more than one byte. So NUMBER is the iterations, but I guess they’re looking for an answer in bytes, and it’s much less than 100M iterations?
- thundergolfer 3y agoYes there’s a bug: https://thundergolfer.com/performance/profiling/2022/08/05/stringio-bytes-written-per-second/ https://thundergolfer.com/performance/profiling/2022/08/05/s...