UI: Increase File Browser Minimum Cache size #107711
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#107711
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Harley:CacheSize"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Increase minimum size of the sliding window cache size from 256 to 1024
The File Browser keeps a sliding window cache of listed items. Currently this cache starts with a size of 1024, set in FILELIST_ENTRYCACHESIZE_DEFAULT. In all cases while viewing file system items in any thumbnail view this size is reduced to 256. This means that when viewing any listing of more than 256 items the previews are discarded and need to be re-read from the cached thumbnail files. This leads to substantially decreased performance for a list size that is not unusually large.
The purpose of
filelist_file_cache_slidingwindow_set
is to set the cache size approximately twice the size of the number of files shown. For list views this calculated value is typically 128 and so the cache size becomes 256. But for thumbnail views the value sent into this function is in the range of 12-48 and we end up using the current minimum of 256. Note that for Asset lists the value passed is 256 and we use a cache size of 512. This PR just makes the minimum be 1024.Note that the description above of the previews being re-read from cached thumbnail files is currently not working, but will be fixed in #107698. Currently the files that are outside of the cache size continue to display generic icons.
I'm not sure about this, this kind of defeats the purpose of having the cache at all. Of course previews will be more readily available while scrolling the more items we keep in memory and that feels snappier, but the point of this sliding window cache is to not have too much unviewed data in memory. In a release build and with an SSD I barely notice that the previews are being reloaded (debug builds are quite a bit slower here).
Using
FILELIST_ENTRYCACHESIZE_DEFAULT
infilelist_file_cache_slidingwindow_set()
makes sense, but I would update that to be 256 since that is the de facto default value it seems.@mont29 your opinion?
@JulianEisel Could consider a compromise of 512 for FILELIST_ENTRYCACHESIZE_DEFAULT? That is the value used currently for Asset lists (256 passed to filelist_file_cache_slidingwindow_set() in AssetList::ensurePreviewsJob).
As a sidenote, I don't think the whole caching adds much value currently, other than the sliding window for previews.
FileDirEntry
is basically a duplicate ofFileListInternEntry
plus the preview. AFAIK the caching was added in preparation of the old asset manager design.General UI code now supports asynchronous loading of previews too (see
PreviewLoadJob
). #107576 already uses this, and performs a lot better with large asset libraries. UI code could also garbage collect unused previews after some time.Honestly, I'm not sure if that's worth it really. Quick calculation, 512 previews at a size of 256x256 would add 134MB of memory, half of that is already a lot for UI resources. Most of these previews don't matter at all while people are just working with the asset browser open. Is it worth using that much extra memory, just for a slightly nicer scrolling experience? I'd rather use time based garbage collection as mentioned.
Also, keep in mind that we may want to increase preview size at some point (e.g. from 256 to 512).
No worries, let's leave this for now. The bad scrolling experience really isn't that terrible. It can seem worse for us because it is much slower in debug mode. It is less noticeable for most users in release. I just wanted us to consider this while I was in here for #106023.
If we move the thumbnail cache (#107298) so we use it exclusively we could could change from PNG to EXR - get a decrease in file sizes and increases in both reading and writing speed. We could then consider having the cache hold those in memory rather than uncompressed bitmaps, only converting when actually drawing or within a window. Could conceivably have previews at 1024
Committed
50d49e24c4
to decrease the effective cache size for asset lists to 256.Pull request closed