Repository navigation
perf(mep): find MEP system members and pipe type names in one pass per stream (B70) - #661
Merged
Merged
Conversation
…r stream (B70) On Autodesk's 2024 MEP basic sample rvt-ifc took 33.5 minutes and rvt-info 0.02 s, so Measure timed out on the MEP samples (B68). Timing checkpoints (scratch run 37216027753, rmebasicsampleproject 2024) put 1,007 s of each walk's schema pass in attach_mep_systems and 24 s in attach_pipe_type_names, and rvt-ifc walks twice (export, then diagnostics). - attach_mep_systems searched every stream once per system for the system's id and, at each occurrence, walked back up to 200,000 bytes trying a data object header at every byte (enclosing_data_object). New partition_room_parameters::data_objects lists a buffer's verified data objects in one pass, trying the Adler-32 only where a header's zero word and both sizes agree; membership now scans the payloads of the objects of the elements asked about for system ids. - find_mep_curve_type_names searched every stream once per id a pipe's record references. It now makes one pass, asking each offset first whether the u64 there repeats MEP_CURVE_TYPE_ID_REPEAT bytes on. With both (scratch run 37218556707, a first version that also changed the untimed pipe diameter scan, since dropped) each walk took 30 s, 4.4 s of it in attach_mep_systems; the type names' pass is in this commit only.
DrunkOnJava
enabled auto-merge (squash)
October 4, 2026 17:18
DrunkOnJava
added a commit
that referenced
this pull request
Oct 4, 2026
… Measure (B68) (#640) B68: pins Autodesk's MEP sample projects (rme_basic and rme_advanced, 2024 to 2027) in research/autodesk-sample-projects.tsv for Measure's samples option. With B70 (#661) and B71 (#664), Measure with every sample, the eight MEP projects included, completes in 7 minutes (run 37221135938); rvt-ifc and rvt-info exit 0 on all eight.
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.
B70: rvt-ifc took 33.5 minutes on Autodesk's 2024 MEP basic sample (rvt-info 0.02 s), so Measure timed out on the MEP samples (B68). Timing checkpoints on a scratch branch (run 37216027753) put 1,007 s of each walk in attach_mep_systems (a search per system id, then a backward search of up to 200,000 bytes per occurrence) and 19 to 24 s in attach_pipe_type_names (a search per referenced id). Both are now one pass per stream; partition_room_parameters::data_objects lists a buffer's verified data objects once.
Note
Medium Risk
Logic changes how partition bytes are traversed for MEP membership and type names; behavior is validated as byte-identical IFC on measured models, but false positives in id-range scans could still mis-associate members or names on unseen files.
Overview
B70 replaces repeated partition-buffer searches with one pass per stream for two hot MEP paths, cutting multi-minute walks to ~10s each while keeping byte-identical IFC output.
Adds
partition_room_parameters::data_objects, which walks a buffer once and yields every verified RE-153 data object (cheap structural checks before Adler-32).scan_mep_systemsnow uses it to attach system members: for each element inelements, it scans that object’s payload foru32words in the known system id range instead ofmemmemper system id plusenclosing_data_objectbackward searches.find_mep_curve_type_namessimilarly scans the buffer linearly for the pipe/duct type layout (ElementId + repeat at +56), filtering by the min/max ofwanted, instead of onememchrsearch per id.Reviewed by Cursor Bugbot for commit 4e7ebbc. Configure here.