perf(registry): resolve embedded operators from a per-family manifest… - #106
Open
dotsimulate wants to merge 1 commit into
Open
dotsimulate wants to merge 1 commit into
dotsimulate wants to merge 1 commit into
Conversation
… index
GetMasterOps() calls get_operator_source() once per operator, and each call
falls back to a deep manifest scan that parses every manifest's OpInfo JSON,
so one fam_create cook costs O(masters^2) JSON parses.
The fast tag lookup never hits: it queries maxDepth=1, but _tag_op() writes
<MANIFEST>/<FAM:>/<TYPE:> onto each master's FamManifest child at depth 2.
Depth alone is not the fix - findChildren(allTags) defaults to False, so a
deeper query would OR-match every manifest and resolve every lookup to the
same master, and <TYPE:> tags keep their case while lookups are lowercased.
Replaces the tag query and the deep scan with one indexed pass per family
({op_type_lower: [master, ...]}), invalidated at the top of GetMasterOps so
it is built once per call and reused by every lookup inside it. The
name-based fallback is unchanged.
TouchDesigner 2025.32820, 133 masters:
GetMasterOps json.loads 18,088 -> 532
GetMasterOps ~89ms -> ~3.7ms
fam_create cook ~97ms -> ~6.5ms
menu view switch 96-101ms -> 7-9ms
GetMasterOps returns 133 rows before and after with an identical fingerprint
(op_name, op_version, op_label per op_type): 0 missing, 0 added, 0 changed.
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.
… index
GetMasterOps() calls get_operator_source() once per operator, and each call falls back to a deep manifest scan that parses every manifest's OpInfo JSON, so one fam_create cook costs O(masters^2) JSON parses.
The fast tag lookup never hits: it queries maxDepth=1, but _tag_op() writes /FAM:/TYPE: onto each master's FamManifest child at depth 2. Depth alone is not the fix - findChildren(allTags) defaults to False, so a deeper query would OR-match every manifest and resolve every lookup to the same master, and TYPE: tags keep their case while lookups are lowercased.
Replaces the tag query and the deep scan with one indexed pass per family ({op_type_lower: [master, ...]}), invalidated at the top of GetMasterOps so it is built once per call and reused by every lookup inside it. The name-based fallback is unchanged.
TouchDesigner 2025.32820, 133 masters:
GetMasterOps json.loads 18,088 -> 532
GetMasterOps ~89ms -> ~3.7ms
fam_create cook ~97ms -> ~6.5ms
menu view switch 96-101ms -> 7-9ms
GetMasterOps returns 133 rows before and after with an identical fingerprint (op_name, op_version, op_label per op_type): 0 missing, 0 added, 0 changed.