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

Retina (hi-dpi) rendering performance and responsiveness #107

Closed
buymeasoda opened this issue Oct 18, 2012 · 26 comments
Closed

Retina (hi-dpi) rendering performance and responsiveness #107

buymeasoda opened this issue Oct 18, 2012 · 26 comments

Comments

@buymeasoda
Copy link
Owner

In an effort to try and resolve any outstanding rendering performance issues with Soda Theme on retina displays, I thought I'd make one ticket to collect and track the discussions.

Here's what I've got so far:

Tip: Upgrade to the latest Sublime Text 2 Build

If you're having display performance problems, the first thing to do is to make sure you've upgraded to the latest Sublime Text 2 build from the Dev or Nightly channel. There have been some important performance improvements to the core ST2 rendering engine that haven't yet been released to the normal build channel.

The current dev build (at the time of writing) is Build 2220, released 20th September 2012, which contains the following change:

Build 2220
OSX: Significantly improved performance on Retina displays

To download the dev build, go to: http://www.sublimetext.com/dev

Helping work out the problem areas

It seems that while Build 2220 has improved things a lot, there are still some noticeable rendering and performance areas.

I'm aware of the influence the quick panel palette (Goto Anything, Command Palette etc) has on scroll and file display performance, so that's one section I'm going to try and address, but I'm curious if there are other areas triggering problems.

If you'd like to help me zone in on any outstanding display speed issues, could you add a comment here with the following details:

  • What basic system you're running on (hardware / os)
  • Which specific section of the application UI is involved and the steps to invoke the slow down
  • How severe is the slowdown?
  • How does the performance compare to the standard default theme?

When assessing the issue, it's important to determine what are core retina + ST2 performance problems, and what aspects are specifically related to the theme.

Changes made to improve performance

For the quick panel palette, which seems to be the main culprit taxing the rendering, there are three components I can change to remove transparency, layers and alpha blending.

I've just committed the first change to one of those, which is to remove the alpha transparency from the background colour of the quick panel.

c1dd0b9

Please let me know if that change has made any visible difference to the performance.

The other two features that can be dropped are the drop shadow around the panel, and the additional layer that was added to provide a top and bottom border for the scrolling list.

Ideally, I'd like to keep as much of the visual features as possible, so if the newer ST2 builds, or these previous changes have brought the performance to an acceptable level then please let me know.

Otherwise, if it can't be resolved, I'll remove those elements from the retina version altogether and that should solve it until the core ST2 rendering is improved in that area.

More discussion and information

If you want to read earlier discussions around to retina and rendering performance, please take a look at the following tickets:

And some Sublime Text 2 forum threads on general retina performance:

@divoxx
Copy link

divoxx commented Oct 18, 2012

I've just updated Soda and tested the quick panel on both my led display (non-retina) and my retina display. It is fast on the led but still slow on the retina.

What do you think of having a separate branch for this fix so we can drop features and try different combinations and see what works better? Maybe drop the drop shadow?

@buymeasoda
Copy link
Owner Author

I've just pushed a new change that provides alternative graphics for the quick panel box. This UI component seems to give Sublime Text the most trouble when rendering on a retina display due to the inclusion of transparency and shadows in the design.

I'd like to get feedback on whether or not this change solves the issues - at least to the point where the performance is brought in line with the standard default theme.

To enable the alternative quick panel for testing, you need to add a setting to your Settings - User file called soda_retina_fix and set it to true.

On a mac (not sure about PC but it'll be similar) the Settings - User file can be find by going to the menu Sublime Text 2 -> Preferences -> Settings - User and an example of how the settings file might look is as follows:

{
    "theme": "Soda Light.sublime-theme",
    "soda_retina_fix": true
}

Make sure to restart Sublime Text to have the change fully applied and the earlier assets properly flushed

Please let me know how you go, if the change improves the performance, and whether or not you think the alternative design should be made the default for the retina version.

@agreco
Copy link

agreco commented Oct 24, 2012

Hey,

just updated the theme and there doesn't seem to be a significant difference in terms of speed..

@buymeasoda
Copy link
Owner Author

Thanks for reporting back.

Just wanted to check one thing, have you shutdown and restarted Sublime after applying the setting? That'll flush any of the old UI if it was previously rendered, as ST2's dynamic reload doesn't remove / reapply some assets, but a restart gets the job done nicely.

And are you seeing the plain square quick panel design? No drop shadow, no rounded corners etc?

After we confirm those two things, if there's still speed problems there's one more change I have that may help. But just want to be doubly sure of the impact of this first lot :)

@divoxx
Copy link

divoxx commented Oct 24, 2012

I can confirm the problem still occurs.

I've just upgraded, I see the square pick panel design, but no significant change on speed :(

@buymeasoda
Copy link
Owner Author

Cool, thanks @agreco and @divoxx for taking a look.

Could you describe a few things with how the slow down occurs?

Unfortunately I don't have a retina MacBook Pro to test on, so flying blind. Hi-Dpi mode on my standard resolution monitor is somewhat useful for testing the assets, but not really everyday performance.

My understanding is the two main scenarios are:

  • Slow editor rendering of quick previews of file contents when using the "Goto Anything" style actions
  • Typing speed? And is it only typing speed where the typing is triggering the action above?

And what's the relative difference between how the default theme performs doing the same actions versus this version? Is it vastly different, or subtle?

I'm also keen to separate how much of this is a core ST2 issue and how much is something I can control and influence via the theme.

@divoxx
Copy link

divoxx commented Oct 24, 2012

Yes, for me the slowness only happens when associated to the "Goto Anything" panel. Typing is slow and the quick preview of contents as well.

FYI, It doesn't happen in the "Command Palette".

@buymeasoda
Copy link
Owner Author

Thanks @divoxx.

How does the speed of doing that action with Soda Theme compare to doing the same Goto Anything action using the standard default theme?

@divoxx
Copy link

divoxx commented Oct 24, 2012

The default theme is fast, the slowdown only happen with Soda.

@buymeasoda
Copy link
Owner Author

Cool, I'll make another change and push it. There's one more feature that differs from the default theme that could be contributing.

@buymeasoda
Copy link
Owner Author

Ok, I've pushed that new change.

Have a go at updating and restarting ST2 and see if it improves things. And soda_retina_fix still needs to be set to true for these changes to apply.

The change was to remove the second layer which is rendered on top of the Goto Anything box for the list display borders (top / bottom).

@divoxx
Copy link

divoxx commented Oct 25, 2012

That did improve, its faster but still does not compare to the regular theme. Damn.

@buymeasoda
Copy link
Owner Author

Yeah, it's a shame things are still not there yet, but knowing that it's still slower than the default theme - despite these changes - does suggest that it's more than just the alpha blending causing the issue.

That alone might help Jon with investigating (and hopefully tuning) the rendering of this feature in the core.

I've just pushed another change that removes the panel background image and replaces it with a flat colour definition, if you want to test that.

@mgcrea
Copy link

mgcrea commented Oct 28, 2012

Just to confirm that I have also encountered the issue (retina mbp), the default theme is way faster. Dropped all my plugins several times, took time to understand that Soda was the culprit. Hop you fix it soon as I really like the theme a lot.

@buymeasoda
Copy link
Owner Author

@mgcrea Could you do me a favour and help test the current tweaks for narrowing in on what is causing the slow down?

Full instructions are above, but the basic steps are:

  • Update Soda Theme
  • Apply the "soda_retina_fix": true to your settings
  • Shut down and restart Sublime Text
  • See what the performance is like and let me know :)

Unfortunately, I don't have access to a retina MBP at the moment, so am relying on feedback from others on what specific features are causing the renderer to choke.

Cheers.

@mgcrea
Copy link

mgcrea commented Oct 29, 2012

Performance is really bad, i get around 6sec of delay with only 3sec of random fast typing.
I enabled the fix, and also set "gpu_window_buffer": true, but no luck so far.

@agreco
Copy link

agreco commented Oct 30, 2012

I've tested on my mbpr and it does seem more snappy..

@buymeasoda
Copy link
Owner Author

I've pushed another change, this one is applied to both the hi-dpi and normal version that removes some extra background colour definitions for the quick panel label text.

Not expecting much to come of that change, but I'm working to make the Soda Theme panel implementation and the Default Theme panel implementation as close to identical as possible, to try and narrow down the issue.

The funny thing is, there's almost no difference between them now, and the next soda_retina_fix change I think I'll make will be to replace the Soda Theme panel with the Default Theme version and see what happens. It's possible that the actual performance degradation isn't being caused by the panel implementation, only triggered by it.

Please keep me posted on how the performance compares to the default theme too.

@ellmo
Copy link

ellmo commented Dec 9, 2012

Using latest build from the repo and adding "soda_retina_fix": true I get much better results than before.

I compared it to the default theme and there seems to be very little difference ( or no difference at all, can't tell really ) when the Go To... Anything panel is displayed.

Good job!

@buymeasoda
Copy link
Owner Author

Thanks for letting me know.

That's at least something - knowing that it's related to the Go To Anything panel itself. I was beginning to wonder if it was something else causing the degradation, and the Go To panel was just the trigger.

@pzgz
Copy link

pzgz commented Jan 8, 2013

I am so glad that I found this thread, after nail down the lag issue to soda theme and I decide to check issues on soda itself and found this. I set flag soda_retina_fix and then the performance on goto anything is back and I am still can using Soda theme right now. Thanks a lot.

@xeno-by
Copy link

xeno-by commented Jan 8, 2013

Submitted a pull request against Soda Refined: jaromero#1.

@s0ber
Copy link

s0ber commented Jan 13, 2013

This fix really helps. Thanks!

@greinacker
Copy link

Just wanted to add another confirmation - this is like night and day compared to running without soda_retina_fix. Thanks!

@PavelVanecek
Copy link

Thanks for this tip! soda_retina_fix helped a lot

@ghost
Copy link

ghost commented Mar 11, 2013

Same here. soda_retina_fix made me happy again :)

@buymeasoda
Copy link
Owner Author

Closing as this seems to be fine now

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

No branches or pull requests

10 participants