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

Use orjson to de-/serialize json-rpc messages #2513

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

deathaxe
Copy link
Contributor

After a recent discussion about json serialization performance, I was curious about impact orjson makes on LSP processing performance.

This PR showcases how orjson as transport de-/serializer.

During recent 2 weeks of daily use, I haven't realized any issues, but also my projects are small enough to not realize any significant impact on overall performance.

Maybe someone using heavy language servers such as typescript can try to benchmark it.

@predragnikolic
Copy link
Member

It can be tested with this package that Rafal wrote
https://github.com/sublimelsp/LSP-performance-test

@deathaxe
Copy link
Contributor Author

According to this plugin, orjson doesn't make any difference. Tests results in 0.189 - 0.192 with both json and orjson on my machine.

@predragnikolic
Copy link
Member

This thread has some information of where bottle necks are located, and how they were solved
#2190

@deathaxe
Copy link
Contributor Author

deathaxe commented Sep 14, 2024

Yeah, and those include json serialization performance being an aspect. With promised performance of orjson I would have expected a little improvement with regards to deserialize messages from language servers. Maybe payload is just too small to outweight overhead for python->C/rust->python translations.

@rchl
Copy link
Member

rchl commented Sep 14, 2024

That test tests performance of our format_completion and not json deserialization. It would have to be modified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants