Conversation
Implements a high-performance LSP proxy in Rust to replace the Node.js version, eliminating the 50MB runtime dependency. The proxy forwards LSP messages between Zed and JDTLS while sorting completion items by parameter count. Key improvements: - 2.5x faster message processing (13µs vs 33µs average) - 771KB static binary vs 50MB Node.js runtime - Cross-platform CI builds for all supported architectures - HTTP server for extension requests with 5s timeout - Parent process monitoring to prevent orphaned JDTLS instances
Move Unix and Windows parent monitoring implementations into separate `platform` modules
|
Some additional info about the new proxy.
A comparison between Node and Rust powered by Opus 4.6 LSP Proxy Benchmark: Node.js vs RustOverviewThis report compares the performance of the existing Node.js LSP proxy ( Methodology
Test Environment
ResultsNode.js Proxy (3,700 messages)
Total overhead: 124,796 µs (~125 ms) Rust Proxy (5,277 messages)
Total overhead: 72,026 µs (~72 ms) Head-to-Head Comparison (Median)
Tail Latency Comparison (P99)
Analysis
Personal touch
|
playdohface
left a comment
There was a problem hiding this comment.
This all looks very reasonable to me, and works without issues on my system, including the debugger 🚀
Things that I had on my mind while reviewing this
- it might be good to include some way to log from inside the proxy for debugging (I think sending a "window/logMessage" is going to make it show up in Zeds Server Logs).
eprintln!will only be shown if we fail to start as far as i can tell - proxy::main could likely benefit from splitting, but for now it's perhaps better as one file, to stay in line with the old one.
| fn encode_lsp(value: &Value) -> String { | ||
| let json = serde_json::to_string(value).unwrap(); | ||
| format!("{CONTENT_LENGTH}: {}\r\n\r\n{json}", json.len()) | ||
| } | ||
|
|
||
| fn encode_lsp_serializable(value: &impl Serialize) -> String { | ||
| let json = serde_json::to_string(value).unwrap(); | ||
| format!("{CONTENT_LENGTH}: {}\r\n\r\n{json}", json.len()) | ||
| } |
There was a problem hiding this comment.
this could just be encode_lsp(value: &impl Serialize) -> String
This PR introduces a new proxy written entirely in Rust.
The proxy sits between Zed and JDTLS, forwarding LSP messages bidirectionally, sorting completion responses by parameter count, and exposing an HTTP server for extension-originated requests.
Motivation
Other changes included
justfilewith dev commands (proxy-build,proxy-install,ext-build,fmt,clippy,all)