Open martinlippert opened 5 years ago
Gson allows to annotate a class or a field with @JsonAdapter
to provide a type adapter factory for instances of that type or field. We already use this at several parts of the protocol to ensure we can parse and serialize correctly according to the spec. I guess this mechanism should work for performance improvement, too.
I experimented with a custom type adapter. It brought us a little speedup, but not a substantial one.
Cool to see that you found the time to experiment with that, much appreciated. Is there a way for me to try this out? Is that already available in a CI build?
Yeah, not a huge difference, but a difference... :-) Thanks for taking a look into this and trying this, much much appreciated.
While working on our language server I observed that serializing a larger number of symbols to JSON (when sending back the results for the workspace/symbol request) consumes quite a bit of time. I wonder if it would be possible to optimize this serialization specifically for symbols, e.g. by replacing the standard reflective collection serialization with a custom-made serialization for the collection of symbols.
Any idea how this could be implemented?