in reply to Is print faster than syswrite?

print is the system library, which uses a buffer. So if you write using print() you will less often access the disk - and hence, wait far less for it to finish.

syswrite access the disk each time you write. This prevents the clobbering you see (and makes it less likely to lose data if your program unexpectly dies), but you pay the price you see.

Replies are listed 'Best First'.
Re^2: Is print faster than syswrite?
by ikegami (Patriarch) on Jan 27, 2009 at 13:50 UTC

    print is the system library, which uses a buffer.

    Which is defeated by closing the file after every print. ( Missed the infinite loop )