Vscode File system api performance issue

We opened this issue: https://github.com/eclipse-theia/theia/issues/9514
Can you give us some tips on how to investigate and find the root cause for vscode filesystem api calls
taking longer than they do in vscode
we are not familiar with the entire flow.
how can we analyze it?

It’s difficult to put timing code inside the production code. What I would try is to look at the parts of the messaging protocol and make experiments with data blocks the size of the files in the issue (500k should show results).
We’re using the messaging implementation from the vscode-languageserver-node package. Some interesting questions:

  1. If I just transfer 500k over a websocket on localhost, how much time does that take
  2. What if I run the same transfer over a message connection
  3. What if I run the same throught a proxy to invoke a back-end service.

This should point us toward the culprit we need to investigate further.

It would be nice if there was some stupid mistake we could just fix, but I doubt that, t.b.h.

After testing item 1:
We did a simple test to measure the most simple websocket performance
our measurements show that approximately for each 1k of data it takes 1ms to pass.

On every call of vscode api we see many WS calls, and those add up very quickly.
In our case passing 500k takes in a range of 500ms (or similar magnitude of time )
Our tests were conducted on my local machine without the additional latency

Regarding item 2, what is message connection? can you please share an example?

  1. 1ms transfer time per kb seems a lot over a naked websocket if the browser and back-end are on the same machine. It’s roughly equivalent to a 10mbit connection. Could you share the code you use for the measurement? (Not here, but in https://github.com/eclipse-theia/theia/issues/9514)

  2. MessageConnection, as created in ElectronMessagingContribution#listen().