lib43
lib43 copied to clipboard
implement a cleanup function (_fini?) instead of manually invoking fflush(stdout)
Going forward, I want to think about the ability of a lib43 user to tune the runtime. One of the most useful cases right now is beating the startup/teardown cost of every other libc and crt0 I've tested, sometimes by a significant margin.
Adding a _fini function that does anything like fflush() on all file descriptors could waste even precious nanoseconds which is useful if using lib43 for competitive reasons.
Probably either cmake -DUNSAFE_BUT_FAST=1 or individual flags like cmake -DFLUSH_WRITES=1
Agreed but it should maybe be tunable on a by feature basis in an organized way. Same arguments could apply to argv passing in some cases and other things as well.
On Feb 21, 2015, at 5:26 PM, Ryan Hileman [email protected] wrote:
Probably either cmake -DUNSAFE_BUT_FAST=1 or individual flags like cmake -DFLUSH_WRITES
— Reply to this email directly or view it on GitHub.
setting up argv is like two instructions, while "flush all open file handles" is actually a ton of work and potentially many syscalls.
I realize that - my point is just that there may be other things people may want to turn on and off as more stuff goes into library so having a methodical way to do so is good. Unwrapping argv is potentially more depending on what compiler decides to do for function prologue but it still wouldn't be that expensive true.
On Feb 22, 2015, at 12:11 AM, Ryan Hileman [email protected] wrote:
argv is like two instructions, while "flush all open file handles" is actually a ton of work and potentially many syscalls.
— Reply to this email directly or view it on GitHub.