Expression Completer: speedup property completion#27137
Merged
sliptonic merged 2 commits intoFreeCAD:mainfrom Jan 26, 2026
Merged
Expression Completer: speedup property completion#27137sliptonic merged 2 commits intoFreeCAD:mainfrom
sliptonic merged 2 commits intoFreeCAD:mainfrom
Conversation
Cache object property list in expression completer, so it is not rebuilt for every requested index. This helps with performance when an object has a large number of properties.
for more information, see https://pre-commit.ci
kadet1090
approved these changes
Jan 24, 2026
Collaborator
|
Successfully created backport PR for |
Contributor
|
@Lgt2x this is great! Now that you are a completion expert, I'd like to try and implement a FreeCAD setting to switch between only listing Labels in the expression editor (but still allowing Names even if not proposed) and listing both Names and Labels (current behavior). Where should I start? |
Member
Author
|
Hey @galou , I suggest you open a dedicated issue, to get feedback from the design working group. Once the design has been validated, implementation should be pretty straightforward |
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.
Cache object property list in expression completer, so it is not rebuilt for every requested index. This helps with performance when an object has a large number of properties.
Before this change,
getCachedPropertyNamedListwas called for every index property of the object, creating a new list every time. This had a significative impact on completion speed when the number of properties is in the thousands.A new
ExpressionCompleterModelobject is created every time the expression dialog is brought up, so there should not be cache invalidation issues (feel free to confirm that).mutablekeyword is required for const-correctness.Issues
Fix #5644 (originally opened almost 10 years ago!)
Before and After Images
On this statefile, open an expression dialog:
prop_complete.FCStd.zip
This file has an object with 10k props.
Before change (real time):

After change:
