3 ms·
Curious about language servers (especially those implementing LSP): how do they achieve low-latency responses? My understanding is that JSON-RPC is used, which
by wenc 8y ago
Curious about language servers (especially those implementing LSP): how do they achieve low-latency responses?
My understanding is that JSON-RPC is used, which is relatively high overhead. Are there lighter weight alternatives? (gRPC?)
- tragic 8y agoBecause they're typically running locally they're quick, or at least as quick as your hardware will allow. The json-related latency is typically dwarfed by the latency from actually doing the functionality (parsing the code for code completion, etc). So the real work is in having a good story for incremental compilation and a generally quick and robust compile toolchain. I guess that Go is in a good position here ...
- int_19h 8y agoThe key word is "relatively". You're comparing it to protocols that are designed to process much heavier loads than what typing generates. And don't forget that processing is usually asynchronous, and can be spun off to a separate thread, so you get one just for protocol handling.
- scns 8y agoThe xi editor uses json to communicate with its backend. The author wrote about negligible overhead