Repository navigation
Tiled Line Numbers - #7101
Tiled Line Numbers#7101
Conversation
This reverts commit f2bab35f57c05d5a0bb21e9fb02117f802ff278b. It didn't actually improve performance, nor memory usage, therefore I decided to avoid changing it for the time being.
|
🙇 🙇 |
|
This is looking very nice. Any thoughts on how we could use composition for the |
Conflicts: src/text-editor-presenter.coffee
|
I've been using this regularly for the past day (just normal use) and it's been smooth sailing so far ⛵ |
Conflicts: src/lines-component.coffee src/text-editor-presenter.coffee
|
Pretty excited to get this merged. What kind of support / feedback do you need to reach the 🎯? |
Yeah, I am sorry for the delays on this but I have been quite busy with the tiled editor bugs that some users reported and wanted to fix them first. I feel quite good about those now and I should be able to deliver this quite soon (this weekend I will probably have more time to actually work on it). I understand this is quite crucial, as it allows a more expensive computation on the text measurement side without affecting UX. Hopefully, we can 🚢 this ~ by the end of this week and start making some progress on #6083 (although I suspect I am probably going to start off a new branch, as the new mechanism we'd like to try is fairly different and master has changed quite a lot). @jssln: have you had the chance to have a look at this? Do you think this new strategy could break custom gutters? If yes, which issues do you think could arise? Any feedback is very welcome and much appreciated! ✨ 🙇 |
|
@as-cii Just saw this! I will take a look asap -- this is probably in a few hours, but definitely today. |
There was a problem hiding this comment.
Without making changes to custom-gutter-component.coffee to account for this, custom gutter decorations will be broken by this change.
Smaller issue: can you update the comment on line 16 above?
|
by the way, here are some snippets you can use to test a custom decoration in a custom gutter (just paste in the console): Some things to test:
|
|
I have performed a couple of refactorings as well as completing the missing parts. This should be a drop-in replacement and no external behavior should appear as changed. I'd like to let this bake for a while but I think we're almost ready to @jssln: I ended up not touching the custom gutter at all, therefore the tests you suggested work just fine and there shouldn't be any difference in there. Still, I'd be super grateful if you could have a final 👀 on this to catch eventual regressions. @nathansobo: any feedback from your side is very welcome as usual and it'd be great to have your opinion about these changes. ✨ @mnquintana: thanks for trying this out! I feel like this is almost finished so it would be awesome if you could try it again and attempt to break it. We've caught a couple of bugs after we've released #6733 and I'd ❤️ to have a reasonable confidence before 🚢ping this (although I am quite sure this won't be as disruptive as that PR). Would you be willing to help out with that? 🙏 Thanks everyone! 🤘 |
There was a problem hiding this comment.
We should avoid passing the presenter around. Are you planning to refactor this later?
There was a problem hiding this comment.
Not really, as we are already passing it in LinesComponent as well as in LinesTileComponent. I agree, though, this is an unhealthy dependency and, as far as I remember, I added it only for testing purposes (e.g. lineNodeForScreenRow and lineNumberNodeForScreenRow).
I am going to get rid of it everywhere possible and leave the responsibility of converting rows to tiles up to TextEditorComponent. I'll /cc you in the relevant upcoming commit.
Nice suggestion! 🎇
Although we have a couple of components which still access it, we agreed it would have been just better to avoid relying on `TextEditorPresenter` where possible and use it purposefully in other places (e.g. `LinesComponent` which needs it to store text measurements). /cc: @jssln
|
@as-cii I think the only thing holding this back is that the tiles need an opaque background for the same reasons the lines did, subpixel anti-aliasing. Good seeing you in Nashville and hope you had a good trip back! |
For sure! I also introduced some assertions to ensure we don’t lose this behavior in the future. Thank you for spotting this! 🙇 |
|
Thanks for finishing this out. It'll be a great relief to GPUs worldwide. |
Please, note that this is still a work in progress but it makes use of the tiling technique adopted in #6733 for line-numbers as well.
On average, with these improvements we basically halve paint times. This is a screenshot before gutter tiling:
And this is after:
To see the difference, please have a look at them at full-screen. Benchmarks were performed using the following script on
text-editor-component-spec.coffee:Chrome further confirms we have a ~50% speedup on paint times:
A byproduct of this change is that we'll be able to paint more than ~750k lines! 🎉
I took the chance to extract out a
TiledComponentwhich aims to cleanly abstract away all the complexity of creating a tile on screen and moving it up and down. I think there is a similar duplication inTextEditorPresenterbut I'd like to a wait a bit more before introducing an abstraction in there, too.What's missing
TileComponent(it clashes withTiledComponent). I think we should keep the latter and get rid of the former, e.g.TileComponent -> LinesTileComponent.TiledComponent)gutter-component-helpers.coffeelook suspicious), but you did a great job on the gutter and I'd ❤️ to have your feedback 🙇if @newState.maxLineNumberDigits isnt @oldState.maxLineNumberDigitsand handle that scenariotext-editor-presenter-spec.coffee's tests names/cc: @nathansobo @maxbrunsfeld