Repository navigation
macOS: hidden tabs free their pixel buffers, spare surfaces purgeable (255 MB -> 84 MB with 3 tabs) - #7
Merged
Conversation
…re purgeable At a 1680x992 Retina window every copy of the screen is ~27 MB: the framebuffer plus up to three IOSurfaces, in every native tab (each is a window), visible or not. - A window that is hidden (background native tab, minimised, covered) frees its framebuffer and surfaces, and repaints from scratch when it shows again. Titles and OSC 52 still apply meanwhile. - A visible window marks surfaces it isn't showing as purgeable once the compositor lets go of them, so macOS doesn't count them and may take them back; they are rewritten if it does. - Tests no longer read the user's config file. Footprint (1680x992 window, idle shell): 1 tab 100-126 MB -> 77 MB, 3 tabs 255 MB -> 84 MB.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
litty used 147–168 MB on a Mac with a large window. Almost all of it was copies of the screen: at 1680×992 on Retina each copy is about 27 MB. Every window kept a framebuffer plus up to three IOSurfaces, and on macOS every native tab is a separate window, so hidden tabs paid the full cost too.
Changes
Occluded. When it's shown again it repaints from scratch in one frame. Tab titles and OSC 52 copies still apply while it's hidden.kIOSurfacePurgeableVolatile, so macOS doesn't count it against litty and may reclaim it. If it has been purged, the whole frame is rewritten on next use.~/.config/litty/config. Before this,cursor = barthere madecursor_style_requestsfail.Measured (macOS
footprint, 1680×992 window, idle zsh)Linux is unchanged: X11 doesn't report occlusion, and softbuffer keeps a single buffer. 83 tests pass on macOS and 82 on Ubuntu, with no new clippy warnings.
Not tested by hand
Switching back to a background tab or un-minimising should repaint in one frame. The numbers above come from
footprinton launched windows; nobody has clicked through tabs on screen yet.