Hi, I noticed that adding response headers is expensive. One reason is that many instructions are executed for the snprintf() calls which are invoked when building response headers (build_header_response()).
There is an sprintf accelerator called qrintf which rewrites invocations of sprinf/snprintf to optimized forms. This is done by preprocessing the source files using a filter program. See: https://github.com/h2o/qrintf This is provided under the MIT license, and I believe it is used in the H2O HTTP server/library. Using this preprocessor on libmicrohttpd results in a significant reduction in the instruction count for adding response headers during runtime. My question is whether this is something that could be considered for use by libmicrohttpd in a future release. It would be helpful to improve the performance of adding response headers. Thanks, Ariel