varlink / libvarlink

C implementation of the Varlink protocol and command line tool
Apache License 2.0
87 stars 15 forks source link

[RFC] Optimize message generation in object.c. #45

Closed ericonr closed 2 years ago

ericonr commented 3 years ago

Avoid using printf-like functions when not necessary; this avoids scanning the string before writing it.

Can be done for more files as well. To minimize the diff and logic differences, using only fputs instead of a combination of fputc and fputs might make sense.

haraldh commented 3 years ago

Seems like a good compiler already does this ... http://www.ciselant.de/projects/gcc_printf/gcc_printf.html

haraldh commented 3 years ago

but yeah...

2.1 No optimization if return code is used