olliNiinivaara / GuildenStern

Modular multithreading HTTP/1.1 + WebSocket server framework
MIT License
80 stars 7 forks source link

benchmark compare to other frameworks ? #8

Closed bung87 closed 1 year ago

olliNiinivaara commented 1 year ago

This benchmark seems only to test "the max rev of an engine" which is not very useful info. Anyway, here is the idiomatic ( = efficient, expressive, elegant) way to implement the request handler functionality required in that benchmark:

if ctx.isUri("/") or not ctx.isMethod("GET"): ctx.reply(Http200)
else:
  let id = ctx.getUri()[6 .. ^1]
  ctx.reply(id)