Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable bundleStrings RPC extension #11636

Merged
merged 1 commit into from
Sep 7, 2022
Merged

Conversation

msujew
Copy link
Member

@msujew msujew commented Sep 5, 2022

What it does

Closes #11624
Closes #11631

Disables the bundleStrings encoding/decoding extension for msgpackr. Although it aims to improve performance, it leads to decoding errors on large objects (> a few mb).

How to test

  1. Open Theia and run the Configure Display Language command.
  2. Change to any other language and reload the window
  3. Plugin support should continue to work as expected (see Switching language breaks plugin support #11631)

Review checklist

Reminder for reviewers

@msujew msujew added the messaging issues related to messaging label Sep 5, 2022
@msujew
Copy link
Member Author

msujew commented Sep 5, 2022

cc @tortmayr I'm open for any other ideas on how to address this issue. Feel free to suggest something else than disabling the bundleStrings extension.

@tortmayr
Copy link
Contributor

tortmayr commented Sep 6, 2022

Thanks! :Change looks good to me, I can confirm that plugin support now works as expected after switching the language. 👍🏼

cc @tortmayr I'm open for any other ideas on how to address this issue. Feel free to suggest something else than disabling the bundleStrings extension.

I also looked into this issue and for the moment it looks like the only option is to disable the bundleStrings extension. Luckily for us the performance hit should is only minor because only the browser string decoding/encoding is affected. In the backend we can still rely on the fast node string parsing.

I also extended and rerun the benchmark extension (introduced for #11159):

Results

Testruns: 500

TestCase 1.26 (JsonRpc) 1.28 (custom codec) Master(Msgpackr) PR (Msgpackr-BundleStrings) Description
Small 0.80 ms
(SD: 3.18)
1.00 ms
(SD: 8.01)
0.90 ms
(SD: 2.3)
0.9 ms
(SD: 1.95)
Simple object with 3 properties of primitive type
Medium 0.90 ms
(SD: 3.52)
1.15 ms
(SD: 6.78)
1.00 ms
(SD: 2.52)
1.0 ms
(SD: 2.68)
Array that contains 6 objects with nested properties
Large 148.60 ms
(SD: 11.56)
345.85 ms
(SD: 49.52)
42.60 ms
(SD: 8.87)
69.55 ms
(SD: 13.61)
Large Object (8MB serialized). (Captured result from a getDeployedPlugins request in the example application)
Buffer 850.6 ms
(SD: 27.05)
17.30 ms
(SD: 23.52)
16.00 ms
(SD: 8.18)
15.80 ms
(SD: 7.22)
8MB binary buffer
LargeString 57.80 ms
(SD: 7.94)
226.65 ms
(SD: 42.61)
15.20 ms
(SD: 6.65)
20.10 ms
(SD: 7.19)
Large object with lots of string data (4MB serialized)
RandomString 29.75 ms
(SD: 6.88)
7.55 ms
(SD: 13.86)
6.70 ms
(SD: 5.09)
6.70 ms
(SD: 5.19)
Array containing 100 random strings of length 1000

It looks like disabling the bundleStrings option has almost no performance impact on small to medium objects. The performance degradation is only really noticeable in really large objects with lots of really long strings. And even then the performance is still way better than what we would achieve with the old JsonRpc or custom message codec.

I'm going to open an issue for this in the msgpackr repository. If a fix for this becomes available we can reactivate the bundleStrings options.

@msujew
Copy link
Member Author

msujew commented Sep 6, 2022

@tortmayr Thanks for looking into it and rerunning the benchmarks! Really appreciated :)

Copy link
Contributor

@colin-grant-work colin-grant-work left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirm the problem on master and that this change fixes it. 👍

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed the bug on master, and that the change fixes it 👍

@msujew msujew merged commit 03b8549 into master Sep 7, 2022
@msujew msujew deleted the msujew/disable-bundled-strings branch September 7, 2022 13:59
@github-actions github-actions bot added this to the 1.30.0 milestone Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CommunityReleasePatch1.29 messaging issues related to messaging
Projects
None yet
4 participants