Conversation
bc4e1ea to
d37ab29
Compare
d37ab29 to
34162ac
Compare
|
Hey @aeschli, did you have time to take a look on this one? |
|
@aeschli Sorry for pinging again, but can you take a look on this one? |
|
Using the generator is an interesting idea. It's not something we in VS Code could use right away given the way the rest of our APIs are designed. |
|
I think this feature can help reduce memory usage but it also introduces I hope in the future vscode will support a way to send partial updates to the UI, if it happens, then we can use a feature like this with the full power. |
|
At this moment there's just too much missing to make the generator API useful.
I don't see us getting there any time soon. I'd rather not maintain an API that we don't use. If you depend on it, I think it is fait to copy the code and maintain it on your side |
This PR adds a new method to be able to consume the
formatedits using generators, which can help reduce the amount of memory needed to process a heavier json.With the current implementation, using the benchmark of #81, we had a slowdown while using
syncresult:But, if we consider how this API can be used, for example to replace the current implementation of format on vscode-json-language-service, we have good results:
Before:
text-format-with-map.js
After:
test-format-with-map-generator.js
This new approach will be faster and also will consume less memory 🚀