4 ms·
> calling the backend via simple subprocess/stdio communication why is this faster/better than the frontend calling the backend through say, nginx proxy_pass o
by 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.