question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Investigate compressing TS Server socket communication

See original GitHub issue

Problem

On desktop, TS Server uses a json based protocol. This protocol up being quite verbose for larger documents, especially for requests such as navTree which return results from the entire file

Just opening checker.ts for example results in individual requests and responses that are a few MB in size.

Proposal

We’ve seen up to a 10x reduction of on the wire data by enabling websocket per-message compression for VS Code’s internal communications. We aren’t using web sockets here, but I believe we should be able to fairly easily compress individual messages on the server side and decompress them on the editor side. Most importantly, we could enable this without any changes to the json protocol itself.

For backwards compatibility, this would have to be an opt-in feature

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
amcaseycommented, Mar 10, 2021

I wonder if there’s an intermediate approach where only the body property of the response is compressed? That might make it easier for the server to decide per-message whether compression is worthwhile (assuming the client has opted in via user-preference).

0reactions
Kingwlcommented, Apr 1, 2021

would require a Accept-Encoding header in the request.

Seems we are repeating http protocol. :XD.

Another problem is TypeScript does not have external dependency (If i’m correct). So will we add something (for gzip) dependency, or just implement yet another compressor?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use node's ipc for desktop TypeScript server #46417 - GitHub
Investigate compressing TS Server socket communication #43156 · JS/TS protocol buffer hangs onto a lot of memory if on big request or response ......
Read more >
TCP Client/Server Communication | I/O Device Guide
Describes remote communications between server and client systems using the TCP/IP protocol from InterSystems ObjectScript.
Read more >
Network data transmission and compression in Java
Before getting into data compression as one possible solution to addressing I/O delays, I'll review some basics of Java network programming.
Read more >
Explain Like I'm 5: Remote Desktop Protocol (RDP) - CyberArk
At this point, the client sends an encrypted Client Info PDU containing information about supported types of compression, user domain, username, ...
Read more >
Socket sharding with kdb+ and Linux | White Papers
Incoming connection requests to this port number are allocated by the Linux kernel to a listening process, allowing user queries to be spread...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found