3 ms·
Where would your hand-optimized C differ?
by jdc 7y ago
Where would your hand-optimized C differ?
- rini17 7y agoFor a start, getc() isn't a simple macro accessing read buffer anymore, but a function which always acquires/releases a lock (even in single-threaded program). Changing it into getc_unlocked() usually makes big difference. http://man7.org/linux/man-pages/man3/unlocked_stdio.3.html http://man7.org/linux/man-pages/man3/unlocked_stdio.3.html
- bonzini 7y agoThe linked code uses read(), not getc().