Page MenuHome

Fix T103187: Opening node search menu is slow because of assets.
ClosedPublic

Authored by Julian Eisel (Severin) on Dec 13 2022, 6:42 PM.

Details

Summary

Flamegraph by @Jacques Lucke (JacquesLucke):


It shows that most time is spent in the filtering, especially in BLO_library_path_explode(). This seems like a cheap function but turns out it does a file system query. This code path is called a lot, so this ended up being a significant bottleneck.

The BLO_library_path_explode() call should actually not be needed, we already have all the information available. This also makes the preceding path joining unnecessary which also shows up in the flamegraph for a fair amount of time.


Note that this could be optimized further, but at least it's keeping Blender in a much more usable state now.

Diff Detail

Repository
rB Blender
Branch
asset-load-lag (branched from master)
Build Status
Buildable 25026
Build 25026: arc lint + arc unit

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Dec 13 2022, 6:42 PM
Jacques Lucke (JacquesLucke) created this revision.
Hans Goudey (HooglyBoogly) added inline comments.
source/blender/editors/space_file/filelist.cc
853

LGTM.

A better description would be nice. As I understand it, the main change is that it does not parse the path anymore in order to get the id type, because the id type is already stored in FileListInternEntry. When parsing the path, the file system was accessed, which led to the slowdown.

This revision is now accepted and ready to land.Dec 15 2022, 3:22 PM
Julian Eisel (Severin) edited the summary of this revision. (Show Details)Dec 15 2022, 3:26 PM