-
Notifications
You must be signed in to change notification settings - Fork 184
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
add NO_UNDO flags to all regions #2370
Conversation
I will start testing this |
I wonder is there any reason why NO_UNDO was not added when drawing the regions in Line 127 in 34c49dd
I doubt that there is a measurable performance difference from doing that, because those regions are drawn only a single time for each view, but it probably also doesn't hurt to add the flag. So I would add it just for consistency. And then I would probably also add the HIDDEN flag, which in this case doesn't have any effect because the regions are empty anyway, but it feels more correct to have it and it might make the code a bit more comprehensible. Perhaps NO_UNDO is implied anyway when the HIDDEN flag is set, but I guess explicit is better than implicit ;-) For example REGIONS_INITIALIZE_FLAGS = sublime.HIDDEN | sublime.NO_UNDO (haven't tested though) |
Seeing decent memory savings on this branch. This is tested on the typescript-language-server repo with 10 different files opened showing semantic tokens and code lens annotations. The physical session file doesn't seem to be affected much. Which I guess makes sense because those regions don't survive restart so those are only stored in memory. BeforeAfter |
I haven't noticed any issues with this. |
Added
NO_UNDO
flag to all (?)add_regions
calls. I have not really battle tested it yet so intending to spend some time doing that and checking whether there are any downsides.Resolves #2359