3 ms·
How is the 'write a byte to disk' loop faster than the empty loop? Maybe xrange() is dominating in the empty loop example.
by herdrick 6y ago
How is the 'write a byte to disk' loop faster than the empty loop? Maybe xrange() is dominating in the empty loop example.
- krick 6y agoIt's number of bytes, not loop iterations.
- formerly_proven 6y agoBecause it's writing one megabyte per iteration.
- Nitramp 6y agoAs others have commented, it's bytes per second. But also, they are not flushing the file to disk, so this might really just writing to memory (in form of the OS's page cache).