4 ms·
Is this code that they are beating actually 'hand-optimized C'? Because the C code at a glance I didn't get that impression.
by djmips 7y ago
Is this code that they are beating actually 'hand-optimized C'? Because the C code at a glance I didn't get that impression.
- deleted 7y ago[deleted]
- jdc 7y agoWhere 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().
- yxhuvud 7y agoYes, the C is much too readable. Also I wonder how fresh it is - the Macs have been known to run some really old versions of GPL tools due to license issues with newer versions.
- saagarjha 7y ago2008, and I'll have you know that it's Copyright (c) 1980, 1987, 1991, 1993 The Regents of the University of California. All rights reserved.