Sublime Forum

Anecdotal Issue: macOS TouchBar Support Performance Issues

#1

Over the past month or two, I’ve noticed Sublime having some uncharacteristically severe performance issues. Frame rate drops within the editor buffer have been the most obvious exemplar, affecting cursor animations and even the speed at which I could move the cursor between lines. By trial and error, I’ve discovered that these issues are progressive and related to how long I’ve had Sublime open, and they can be fixed by restarting the application (note: I have hot exit enabled). The amount of time it takes to accumulate performance degradation to where it is annoying has generally been around 2-3 days of having the editor open. This time seems to be independent of the number of separate projects I have open at the same time, but does appear to be correlated weakly with the number of files I have open in a single project.

Anyway, I couldn’t figure out what it was, and I was deeply concerned that it might be a memory leak in the syntax highlighting triggered by some of the complexities of the Scala mode (which would mean that I’d have to track things down further). Then, the other day, I noticed that the ControlStrip process on my system is using a whopping 500 MB of memory, at which point I realized that Sublime’s use of the TouchBar is probably not well optimized for my workflow. Specifically, Sublime defaults to adding every open file to the TouchBar, and I usually open dozens and dozens of files simultaneously (I almost never close files). This didn’t seem to be particularly efficient, and since I’m not using the TouchBar support anyway, I decided to disable it in preferences ("show_navigation_bar": false).

Since I did so, I haven’t even once experienced the performance degradation I had been noticing over the past several months. Sublime has been back to its usual buttery-smooth self.

Without spending much more time on reproduction, it’s hard for me to say exactly what the trigger is, but based on what I’ve seen, I would guess that there is a resource leak relating to how Sublime populates the TouchBar, and that resource leak is proportional to the number of files open.

This is with the dev build (3140 at present, but I’ve seen it over every build for the past several months) obviously, predominantly editing Scala files with the built-in Scala mode plus all of my open PRs, though the performance issues manifest in every file type equally. According to len(sublime.active_window().views()), I currently have 89 open files in a single project (one window), and I haven’t been doing anything outside of my normal workflow.

0 Likes