3 ms·
Some of Bun's server speed can be attributed to uWebSockets, which has node bindings [1]. Of course this is just a small detail, since Bun is a huge project. [
by matesz 4y ago
Some of Bun's server speed can be attributed to uWebSockets, which has node bindings [1]. Of course this is just a small detail, since Bun is a huge project.
[1] https://github.com/uNetworking/uWebSockets/discussions/1466#discussioncomment-3114410 https://github.com/uNetworking/uWebSockets/discussions/1466#...
- joshxyz 4y agoalex got good points here as usual. it's been a long time since i've used node's built-in http module since I've found uwebsockets.js.
- matesz 4y agoGood to hear there are others successfully using uwebsockets.js! We are using it in very early stage project, not production yet. Can you share your experience using it?
- joshxyz 4y agoGreat experience with it. The examples in the repo, the issues and discussions sections, and the documentations are all very helpful. Alex and the other users are also quite hands-on in replying on each and every issue and discussion there. We have some thin wrapper for uWebSockets.js that lets us do the following: - parse request json - parse request multipart data - serve response json - serve response buffers - serve response streams - serve response static files - support async handler - support multiple async handlers (middlewares) links are here - https://github.com/joshxyzhimself/modules/blob/main/uwu.mjs https://github.com/joshxyzhimself/modules/blob/main/uwu.mjs - https://github.com/joshxyzhimself/modules/blob/main/uwu.d.ts https://github.com/joshxyzhimself/modules/blob/main/uwu.d.ts - https://github.com/joshxyzhimself/modules/blob/main/uwu.test.mjs https://github.com/joshxyzhimself/modules/blob/main/uwu.test... internally we just serve http, then it goes through caddy or haproxy depending on the project's needs such as tls, caching, etc. there are other similar projects too that tries to deliver express-like api: - https://github.com/kartikk221/hyper-express https://github.com/kartikk221/hyper-express - https://github.com/nanoexpress/nanoexpress https://github.com/nanoexpress/nanoexpress (defunct)
- matesz 4y agoGot to say your code looks very clean - really impressed! Db access, cache access sessions, s3 access and server init with middleware and endpoint interface - in a few short files with practically zero deps! Honestly if it was 2 months ago we would definitely start with this, but unfortunately it is a little bit too late. Oh well
- deleted 4y ago[deleted]