chibi-scheme icon indicating copy to clipboard operation
chibi-scheme copied to clipboard

Make optional logging in http-server

Open the-man-with-a-golden-mind opened this issue 2 years ago • 2 comments

Just by commenting that one line I can jump with http-server performance from 130-160 requests / second to 612 request / second. https://github.com/ashinn/chibi-scheme/blob/67fdb283b667c8f340a5dc7259eaf44825bc90bc/lib/chibi/net/http-server.scm#L57

Try (logger-current-level-set! default-logger 'warn).

It probably makes sense to initialize the log level from an environment variable.

ashinn avatar Jun 30 '23 22:06 ashinn

Why logging is so slow? Maybe we can make it async?

Logging uses custom date formatting written in Scheme and writes all mime headers as an sexp (using the expensive and generalized write).

For now added a --quiet option to disable this. We can also maybe play around with not logging the full headers.

ashinn avatar May 29 '24 13:05 ashinn