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.
ctx000
Takes about a minute now on the reference model.
The biggest change here is that doing traversal on the relationship directly also enters the elements that the material is assigned to and elements have very deep instance trees due to their representations.
Also, HasAssociations is defined on IfcObjectDefinition
pse001
Main problem here is that for every instance we parse the full data structure again to see what is allowed (because previously the loop was inside the step fn). Nothing that some quick caching cannot solve, but it's a bit ugly because of the dictionary that has to be passed. Could be refactored more elegantly probably, but this is the least intrusive I could think of.
alb023
The reference file had 24197 IfcCurveSegments. Looping over them in the decorator and then finding their relevant IfcAlignmentSegment by iterating over the context in the impl function creates exponential behaviour. We have something for this called
full_stack_rull
which not only gives you the instance but a path through the values in all given steps. Implementation of that was broken though.. it assumed that the depth in context.instances increased with 1 every step, rather we need to look at the depth of context.instances (or the stackframe we're inspecting actually) that we have for the frame and then apply as many indexes to that from the numeric path based on that depth. Adding @civilx64 as a reviewer due to this rule.