I noticed that when I ran strlcpy in cc with both directly from libc and
copied from source: “with and without needing a return value”, the libc
strlcpy didn’t change the runtime, but the one from source did;
dramatically (like 50% runtime difference over a several run loop with
15-20 or so characters), where the compiler obviously optimized stuff out.

Is it possible that there’s a way you haven’t considered, that could permit
the compiler to optimize the functions…

(or pre-optimize for the instances with no return value and when there are
different needs, it could choose between the two; if there aren’t dual
needs, then only write one to static programs; I don’t know if this can be
done trivially.)

…which could improve performance without breaking security of functions
which may or may not need a return value to function correctly?!

Or is all the extra runtime from returning from the libc wrapper?
-- 
-Luke

Reply via email to