4 ms·
I don't know the context of why you guys are doing these microbenchmarks, but consider doing proper custom buffering for high speed number conversion. Or at lea
by jstimpfle 4y ago
I don't know the context of why you guys are doing these microbenchmarks, but consider doing proper custom buffering for high speed number conversion. Or at least use fgetc_unlocked() / fputc_unlocked().
The normal FILE reading functions take a lock, which is quite slow for single-byte reads and writes.
- ncmncm 4y agoI guess that answers that question. I had forgotten that C got such a dumb change.
- jstimpfle 4y agoCan't see a good reason for the locking either, other than that printf is commonly used for debugging, which without locking would probably leave a lot of users puzzled with random crashes in multithreaded scenarios.