Skip to content

perf(native): ports and duct shapes read object graphs without the parameter-definition pass (B80) - #690

Merged
DrunkOnJava merged 1 commit into
mainfrom
perf/b80-native-passes
Oct 4, 2026
Merged

DrunkOnJava merged 1 commit into
mainfrom
perf/b80-native-passes

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

native_document::extract first decodes every parameter-definition owner in the file (for saved parameter values), then makes its selected pass. The export's two native consumers, family-instance ports (#680) and duct shapes (#684), read objects' fields only. They now call the new extract_graphs, which makes the selected pass alone.

Measure run 37241187730 (samples, against main) shows the IFC byte-identical on all six models and 36 samples. Wall time across them falls from 288.8 s to 226.8 s:

file main this PR
2025 rme_advanced 44.9 s 32.3 s
2025 rme_basic 39.5 s 28.7 s
2024 rme_advanced 32.9 s 23.8 s
2026 rme_advanced 30.7 s 22.6 s
2025 rac_advanced 5.8 s 4.5 s

Note

Low Risk
Targeted performance path change with measured IFC parity; only affects native readers that do not rely on resolved parameter definitions.

Overview
Adds native_document::extract_graphs, which runs the selected-record object-graph pass only—skipping extract's upfront scan of every parameter-definition owner in the file. Callers that read native object fields (not saved parameter values) no longer pay that definition-ingest cost.

Family-instance port indices (symbol_port_indices) and duct type shapes (duct_type_shapes) now use extract_graphs instead of extract for their FamilySymbol/Family and AbsDuctType passes. Saved metadata on those records is projected with an empty definition registry, which matches graph-only field reads.

Export output stays byte-identical on measured models; wall time drops materially because the definition pass is avoided on these hot paths (B80).

Reviewed by Cursor Bugbot for commit 4684b53. Configure here.

…rameter-definition pass (B80)

native_document::extract decodes every parameter-definition owner of the
file before its selected pass, for saved parameter values. The two native
consumers in the export, family-instance ports (#680) and duct shapes
(#684), read objects' fields only. They now call extract_graphs, which
makes the selected pass alone; their results are unchanged.
@DrunkOnJava
DrunkOnJava merged commit 21286ff into main Oct 4, 2026
25 checks passed
@DrunkOnJava
DrunkOnJava deleted the perf/b80-native-passes branch October 4, 2026 23:12
DrunkOnJava added a commit that referenced this pull request Oct 4, 2026
…per file (B80) (#691)

The original symbols (RE-167), railing types (B45) and MEP systems
(RE-162) each scanned every partition stream for its data objects
(RE-153). `RevitFile::partition_data_objects` keeps each stream's scan,
as it already keeps inflated streams, and the three read it. A data
object is an offset and three words, so the cache is small.

Measure run 37242962338 compares this commit against `main` with #690,
both carrying the same scratch timing checkpoints. The IFC is
byte-identical on all six models and 36 samples. Each step is timed
inside its own export, so runner speed cancels when a step is compared
with untouched steps of the same process. On the 2025 `rme_advanced`
sample the head runner ran untouched steps at about x0.75; the MEP
systems step went from 4.58 s to 0.06 s:

| step, 2025 rme_advanced | main | this PR |
|---|---:|---:|
| original symbols (fills the cache) | 4.38 s | 3.10 s |
| MEP systems (RE-162) | 4.58 s | 0.06 s |
| curve fields (RE-134, untouched) | 7.74 s | 5.21 s |
| fitting sizes (RE-165, untouched) | 6.82 s | 4.53 s |

An earlier pair of runners (run 37241953046) showed RE-134 and RE-165 at
x1.5 with this change. That pair spread untouched steps from x1.00 to
x1.58, and this run puts both with the runner, so it was runner noise.
RE-134's and RE-165's own per-id scans move onto this cache in the next
PR.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Behavior-preserving refactor: same scan logic, shared via cache on
`RevitFile`; only performance and call-site plumbing change.
> 
> **Overview**
> Adds **`RevitFile::partition_data_objects`**, which scans each
partition stream’s inflated bytes for RE-153 data objects once and
stores the result in a per-stream memo (B80), mirroring the existing
inflated-stream cache.
> 
> **MEP system member linking** and **schema MVP** paths (railing type
names and original-symbol resolution) now iterate the cached `(offset,
DataObject)` list instead of calling
`partition_room_parameters::data_objects` on every pass over the same
stream.
> 
> The first consumer that walks all partitions still pays the scan cost;
later steps reuse the cache, which is why MEP systems timing drops
sharply on large models while export output stays unchanged.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
f69632b. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant