4 ms·
quite smart approach of having a nodejs frontend doing what it's good at (async) calling the backend via simple subprocess/stdio communication. they could almos
by baq 8y ago
quite smart approach of having a nodejs frontend doing what it's good at (async) calling the backend via simple subprocess/stdio communication. they could almost say they invented CGI :)
- stevekemp 8y agoMy first thought too! It seems like the speedup they gained was probably as much from the architecture change as it was rust. (That often seems to be the case when people say they saw a significant speedup due to switching to rust, go, or similar.)
- MuffinFlavored 8y ago> calling the backend via simple subprocess/stdio communication why is this faster/better than the frontend calling the backend through say, nginx proxy_pass or REST HTTP calls?
- lugg 8y agoOverhead. Nginx/rest involves the ipstack.
- MuffinFlavored 8y agoIsn't there overheard in spawning processes?
- autarch 8y agoThey're forking a new process for each request. Passing the request data to that process on stdin when you create it is much simpler than spawning a process, waiting for it to be ready, and then communicating with it via http.
- apendleton 8y ago> They're forking a new process for each request. Hm, I don't think they are. I think they one persistent process managing the state of each document, and many requests might interact with that document, via stdin/stdout channels on that document's process. Makes the case for the rest of what you said all the stronger, though.
- nevi-me 8y agoI did this recently, where I compared going through FFI from Java to Rust, vs through gRPC. gRPC wasn't that much slower than FFI, and its benefit would be that I could have 2 services in the network. FFI had overhead, but its performance profile was consistent, very little fluctuation in runtime.
- MuffinFlavored 8y agoDid you also test HTTP? Did you publish these results anywhere?
- Scarbutt 8y agoIn-process is faster.