ashinn / chibi-scheme

Official chibi-scheme repository
Other
1.21k stars 142 forks source link

Make optional logging in http-server #926

Closed the-man-with-a-golden-mind closed 3 months ago

the-man-with-a-golden-mind commented 1 year ago

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

ashinn commented 1 year ago

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

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

the-man-with-a-golden-mind commented 1 year ago

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

ashinn commented 3 months ago

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.