evo-lua / evo-luvi

[Obsolete] Experimental Lua runtime environment built on Luvi (libuv + LuaJIT)
https://evo-lua.github.io
Apache License 2.0
1 stars 0 forks source link

Add support for HTTP1 communications to the Networking API #137

Open Duckwhale opened 1 year ago

Duckwhale commented 1 year ago

Goals:

Roadmap:

Non-goals:

Duckwhale commented 1 year ago

This is just to formalize the requirements after building a couple of different prototypes. Requires #90 (mostly done, needs cleanup).

As for performance, I am using llhttp-native-c and llhttp-ffi as the maximum (both 1 GB/s on my desktop) and luvit (pure Lua, measured at 20-25 MB/s on the same machine) as the minimum. It is clear that the requirement of providing a user-friendly API is directly at odds with reducing overhead, and a streaming API on top of that will also be less user-friendly by default.

For this issue, I will limit the scope to a basic, buffering and somewhat inefficient implementation that is sufficient to proceed with the WebSocket protocol support. Streaming can be performed by simply overriding the event handlers (and then creating async write requests via libuv), while reducing the memory footprint is possible by disabling the FFI layer's event buffering (which comes with other drawbacks). I doubt there's a perfect solution, or even one that fulfills most of the requirements, here.

Duckwhale commented 1 year ago

Blocked by #168, since hacking in the URL parsing logic required for some of the RFC specs doesn't seem like a good idea.