Repository navigation
perf(reader): native extraction reads the file's parameter definitions once per handle, not once per extraction (#1237) - #1239
Merged
Conversation
…s once per handle, not once per extraction (#1237)
…t extraction, and the pass's key names every option (#1237)
Owner
Author
|
Automated Claude Code review (the maintainer's review agent; it read the diff and the Measure artifacts and ran nothing heavy): ready, no blocking items.
|
DrunkOnJava
enabled auto-merge (squash)
October 31, 2026 22:42
DrunkOnJava
added a commit
that referenced
this pull request
Nov 1, 2026
…caveat against 0.11.0, #1239's scope, and the tag's date
DrunkOnJava
added a commit
that referenced
this pull request
Nov 2, 2026
Prepares v0.12.1, a patch release: the two #1237 speed-ups since v0.12.0 (#1239, #1240), with every export byte-identical. - Version 0.12.1 in every file that carries it. That is `Cargo.toml`, `rvt-py/Cargo.toml` and its pin, `rvt-wasm`, the `tools/stream_evidence` pin, `viewer/package.json`, `CITATION.cff`, and the workspace crates in both lockfiles. - `CHANGELOG.md`: - `[0.12.1]` holds one Changed entry, assembled from its fragment; - an introduction; - "Upgrading from 0.12.0" (nothing changes). - README: the release section names 0.12.1, and its slowdown bullet gives the current figures. Measured on one runner: - **Against v0.12.0** (run [41255129905](https://github.com/DrunkOnJava/rvt-rs/actions/runs/41255129905)): all 90 exports and diagnostics byte-identical. 2015 to 2022 projects take 0.84 to 0.97 of the time (−12.7% over thirty), 2023's 0.89 to 0.99, and 2024 to 2027 0.99 to 1.03. No 2015 to 2023 file's peak memory rises. - **Against v0.11.0** (run [41249804617](https://github.com/DrunkOnJava/rvt-rs/actions/runs/41249804617)): 2015 to 2022 projects still take 1.6 to 2.9 times as long and 2023's 1.3 to 1.9 times. 2024 to 2027 take 0.97 of the time. To come in this PR, from its CI: the witness observations and verdicts, and the synthetic fixtures. After merge: the tag, publish, verification and post-release docs.
14 of 15 tasks
DrunkOnJava
added a commit
that referenced
this pull request
Nov 3, 2026
…o reader uses, and a wall's type id and top join are read in one pass (#1237) (#1275) ## Summary Candidates 2 and 3 of #1237's step-level profile: native records stop carrying a body digest, GUID and IFC parameter no reader uses, and the wall type ids and top joins are read in one pass. Measured below: byte-identical on all 90 exports, 1.5 to 5% faster on one runner, one file's peak memory +7%. ## Motivation Part of #1237 (exports of Revit 2015 to 2023 files are slower in 0.12.x than in 0.11.0 because of native record passes). The last comment on the issue lists the candidates; this does 2 and 3. ## Changes - `src/research/native_document.rs`: `Options::record_extras` (off by default) decides whether a `Record` carries `source.body_sha256`, `derived_default_ifc_guid` and `effective_ifc_parameter`. With it off they are an empty digest and `None`, as for an element base record. The body digest's hex is a table lookup into one `String` (`lower_hex`), not a `format!` per byte. The definitions pass forces it off and leaves it out of the pass key. - `src/research/native_saved_scene.rs`: turns `record_extras` on, because each `SavedElement.source` serialises the record's source with its digest. Nothing else in the tree reads the three values (checked by grep over `src`, `tests`, `probes`, the bins and the Python and wasm crates). - `src/research/native_walls.rs`: `WallReads` keeps what reads of walls' native records have found (type ids, top joins, type Functions), each with the walls it covered. `read` makes one pass for the type ids and top joins of the walls not read yet. `native_walls_and_top_joins_into` leaves the walls' type ids and the `BasicWallType` Functions it already decodes in the `WallReads`; `native_walls_and_top_joins` is unchanged for callers. - `src/research/native_wall_types.rs`: `wall_type_id`, `type_function` and `functions_of_types` are the one definition of what both readers take from a record. `wall_type_functions` keeps its signature and result. The Function read of the types is skipped for no types, where it selected every record (the result was empty either way). - `src/research/partition_schema_mvp.rs`, `partition_schema_mvp/walls.rs`, `partition_schema_mvp/types.rs`: `recover_partition_schema_mvp` holds a `WallReads`. On 2015 to 2023, `read_wall_records` makes the one pass before the type Functions are attached; the attach functions run in the same places as before (so `wall.fields` keeps its order), and the top joins are read from what the pass found. On 2024 and 2025 the type ids and Functions come from the pass `attach_wall_layers` makes, and a wall or type that pass did not cover (curtain panel walls, types that are not `BasicWallType`) is read in a pass of its own. No changelog fragment: this is a speed-up with no user-visible change, as for #1239 and #1240. ## Testing Unit tests are banned in this repository: do not add them. Show the change working end to end on real files instead. - [ ] `tools/check-local.sh` passes (fmt, clippy, rustdoc, build, real-file / CLI / contract checks): CI compiles and gates this; nothing is built on the author's machine. - [x] Verified end to end on real Revit files: Measure run 41638716082, results below. - [x] If this touches the IFC exporter: no export changes; the byte identity of every export against `main` is the evidence (below). - [x] If this is a performance change: Measure's `timing` input (base and head on one runner, median of three alternating exports per file) replaces `tools/bench.sh`. ## Measured Measure [41638716082](https://github.com/DrunkOnJava/rvt-rs/actions/runs/41638716082): head `84b558a7` against `main` at `42e07b8f`, `nordic`, `r2025`, `samples` 2015 to 2027, `scorers=none`, `timing`. The timing job builds both refs on one runner and exports each file in turn, median of three alternating runs. **Byte identity.** All 90 exports have the same `ifc.sha256` in `measure-base` and `measure-head`; `diagnostics.json` is byte-identical on all 90, and so is `info.json` wherever one is written. **Time, head / base on one runner** (sum of the files' medians per release; per-file range in brackets). Every file is faster, none slower: | release | files | base | head | head / base | per file | |---|---:|---:|---:|---:|---| | 2015 | 6 | 22.9 s | 22.1 s | 0.962 | 0.93 to 0.99 | | 2016 | 3 | 7.4 s | 7.0 s | 0.950 | 0.94 to 0.98 | | 2017 | 3 | 7.4 s | 7.0 s | 0.949 | 0.93 to 0.99 | | 2018 | 3 | 7.3 s | 7.0 s | 0.958 | 0.95 to 0.98 | | 2019 | 6 | 23.1 s | 22.3 s | 0.964 | 0.94 to 0.99 | | 2020 | 3 | 7.4 s | 7.1 s | 0.953 | 0.94 to 0.98 | | 2021 | 3 | 8.0 s | 7.6 s | 0.950 | 0.94 to 0.98 | | 2022 | 3 | 7.9 s | 7.6 s | 0.954 | 0.95 to 0.99 | | 2023 | 3 | 9.6 s | 9.1 s | 0.953 | 0.94 to 0.98 | | 2024 | 10 | 110.0 s | 106.4 s | 0.967 | 0.95 to 0.99 | | 2025 | 5 | 56.2 s | 54.7 s | 0.974 | 0.95 to 0.98 | | 2026 | 5 | 40.0 s | 39.3 s | 0.983 | 0.97 to 0.99 | | 2027 | 5 | 40.1 s | 39.5 s | 0.986 | 0.98 to 0.99 | | reference models and the office | 8 | 74.7 s | 71.5 s | 0.956 | 0.95 to 0.99 | So about 4 to 5% on 2015 to 2023, 3% on 2024, 1.5 to 2.5% on 2025 to 2027. That is a small part of #1237's gap: the profile's candidates 2 and 3 were about 17% of a pass and 140 ms, and most of the native cost is still the named-parameter read's graph decode (candidate 1). Two further runs on the 2015 samples split the gain by half (timing only; the tips are kept at `refs/archive/2026-11-03/scratch/1237-extras-only` and `refs/archive/2026-11-03/scratch/1237-walls-only`): - extras only ([41646443749](https://github.com/DrunkOnJava/rvt-rs/actions/runs/41646443749)): 0.99 to 1.00 per file, about 1%; - walls only ([41646447860](https://github.com/DrunkOnJava/rvt-rs/actions/runs/41646447860)): 0.94 to 1.01 per file, 2 to 6% on the larger-wall files and none on `rst`. **Peak memory.** Unchanged (within 1 MiB) on every file but one: 2015 `rme_basic`, 361 MiB to 386 MiB (+7%), the same in all three rounds (about 369,900 KiB against 394,700 KiB). The two runs above put it in the wall change: extras only 361 MiB to 361 MiB, walls only 361 MiB to 385 MiB. The cause is not found. `WallReads` holds only id-to-scalar maps (kilobytes) and drops each graph inside its pass, so it is not what holds the memory. On `main` the type-function passes already ran before the named-parameter read; only the top-join pass moved earlier. A heap profile (`examples/dhat_*.rs`) of that file at base and head would show what does. ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR: no claim changes - [x] A user-visible change has its entry as a fragment under `changelog.d/<section>/`: not user-visible - [x] If a limitation was resolved, the "Known limitations" / "What works today" section in the relevant docs is updated: N/A - [x] If a new limitation was introduced, it is documented in the PR body and in-code: none - [x] Commit messages describe WHAT changed and WHY, not "fix things" or "updates" - [x] No emojis in code, docs, or commit messages - [x] No private paths, personal email addresses, or internal jargon in committed files - [x] If this is a reverse-engineering finding: N/A ## Legal and contribution hygiene - [x] I agree this work is licensable under Apache-2.0 (see `CONTRIBUTING.md`) - [x] This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content (see `CLEANROOM.md`) - [x] Any new test fixtures use synthetic values: none added ## Breaking changes None to the stable API. `native_document::Options` (behind `unstable-research`) gains a field; every struct literal in the tree ends in `..Default::default()`. A `Record` read with the default options has an empty `body_sha256` and `None` for the derived GUID and IFC parameter; set `record_extras` to get them. ## Screenshots or output samples N/A: no output changes. ## Related issues Refs #1237 Since the review: `native_wall_types::wall_type_functions` and `native_walls::wall_top_joins`, which production no longer calls but the RE-283 and RE-284 probes do, delegate to `WallReads`; and the change has a `changelog.d/changed/` fragment with the measured gain and the rme_basic caveat (1d89f71).
13 of 15 tasks
DrunkOnJava
added a commit
that referenced
this pull request
Nov 3, 2026
…e named-parameter read decodes only the types its elements name (#1237) (#1301) ## Summary Two more speed-ups for #1237, after #1239, #1240 and #1275. Each leaves every export byte-identical, IFC and diagnostics alike. Together they make exports of Autodesk's 2015 and 2019 `rac_advanced` and `rme_advanced` samples 19% to 21% faster than `main` at 7fd339e, and 2024 to 2025 files 5% to 10% faster. ## Motivation #1237: 0.12.0 exports Revit 2015 to 2023 files 1.6 to 3.9 times as slowly as 0.11.0. The step-level profile there puts most of the time in decoding records' graphs: 796 ms of the named-parameter pass on 2015 `rac_advanced`. This PR takes two of those costs: 1. **The decoder copied the schema for every object.** `Cursor::class` (`native_parameters.rs`) cloned each class of an object's lineage from the registry, every field and field name with it, for each object it decoded. Every native pass goes through it, on every release. 2. **The named-parameter read decoded every type in the file.** `read_defined_values` selected every `FamilySymbol` and system type by class. An element only takes type values from the one type its record names (`master_symbol`), so on these samples most of those graphs were decoded and never used. ## Changes - `src/research/native_parameters.rs`: `Cursor::class` borrows its lineage from the registry (`&'a Class`) instead of cloning it. - `src/research/native_element_parameters.rs`: a values read (`Types::Values`) selects `ids` alone. A second `extract` then reads the types their records name that are not in `ids`. Both extractions share one visitor, which takes the parameter map as an argument so the named types can be read from it in between. A named record of no type class is skipped there, as the class selection skipped it. The kept definition pass (#1239) and the record index make the second extraction cheap. `read_defined_values`' doc says what it now leaves unfilled: `target_name` for a type no element names. Its one caller, `attach_native_named_parameters`, reads names, levels and values, never `target_name`. ## Testing Unit tests are banned in this repository: do not add them. Show the change working end to end on real files instead. - [x] `tools/check-local.sh` passes (fmt, clippy, rustdoc, build, real-file / CLI / contract checks) - [x] Verified end to end on real Revit files: the command, the files (and their licence), and the measured result against Revit's own export are in the PR body, with the script or probe that reproduces it - [x] If this touches the IFC exporter: the witness verdicts replay (see CONTRIBUTING.md) or the changed observations are refreshed in this PR - [x] If this is a performance change: reran `tools/bench.sh` and attached the before / after **Gate.** `tools/check-local.sh --corpus` passes on the branch's head: the family corpus at phi-ag/rvt `bec25470` and the project corpus at magnetar-io/revit-test-datasets `fd755e1`, 282 integration tests. The first commit passes `cargo clippy --workspace --all-targets -- -D warnings` on its own. **Same output.** `rvt-ifc FILE -o out.ifc --diagnostics out.json` with `SOURCE_DATE_EPOCH=1700000000`, `main` at 7fd339e and this branch both built `--profile ci`. Both files are byte-identical on: - Autodesk's 2015 and 2019 `rac_advanced` and `rme_advanced` samples; - RE1 Architecture (2025); - Autodesk's 2025 `rac_basic` sample and Snowdon Towers Structural; - 2024 Core Interior. Each commit was checked the same way on its own. Against Revit's export nothing moves, since nothing rvt-rs writes changes. **Witness.** On 2024 Core Interior, `rvt-ifc --observation` with `--artifact-id magnetar-2024-core-interior` and `-slim` gives the committed `research/witness/*/observations/rvt-rs.json` byte for byte. **Time.** `hyperfine -N -w 1`, median of 5 runs (3 for the 2025 files), one local machine, `main` 7fd339e against this branch: | file | Revit | `main` | this PR | change | |---|---|---:|---:|---:| | `rac_advanced` | 2015 | 5.47 s | 4.32 s | −21.1% | | `rme_advanced` | 2015 | 9.72 s | 7.90 s | −18.7% | | `rac_advanced` | 2019 | 5.58 s | 4.47 s | −19.8% | | `rme_advanced` | 2019 | 9.73 s | 7.92 s | −18.6% | | RE1 Architecture | 2025 | 2.63 s | 2.49 s | −5.2% | | `rac_basic` | 2025 | 7.66 s | 7.19 s | −6.1% | | Snowdon Towers Structural | 2025 | 8.41 s | 7.60 s | −9.7% | Each commit on its own, on the four 2015 and 2019 files: - the decoder borrowing the schema: −9.9% to −11.1%; - types read by name: a further −8.7% to −9.8%. Peak memory is not measured here. The first change can only lower it. The second reads fewer graphs, in two extractions where there was one. A Measure run would give both against 0.11.0, as #1237's "done when" asks. `tools/bench.sh` is not rerun. It times `rvt-info`, `rvt-schema`, `rvt-history` and `rvt-analyze` on the family corpus, none of which runs these passes, and it rewrites `docs/data/bench-2024.*`. **Not done here, for a later PR:** - **The unused per-record values.** #1275 stopped deriving them (`Options::record_extras`), but `Record` still carries `derived_default_ifc_guid`, `effective_ifc_parameter` and their two diagnostics as public fields, which only `native_saved_scene` turns on. Before #1275, removing the four fields and their derivation measured within ±1% on the four 2015 and 2019 files above, and was about 35 lines. It is an API removal, so it is left for whoever cleans up `Record` before 1.0. - **The same SHA-256 hex code in four more places.** `Sha256::digest(..).iter().map(|b| format!("{b:02x}"))`, one `String` per byte, is still in `native_segments`, `schema_registry` (twice) and `native_es_catalog`. `native_document`'s private `lower_hex` from #1275 would replace them if it were shared. Not timed. - **The phase-order pass** (0.35 s on 2015 `rac_advanced`, measured at 895109d). ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR — no claims of features that are not actually shipped in this PR - [ ] A user-visible change has its entry as a fragment under `changelog.d/<section>/` (see `changelog.d/README.md`), not in `CHANGELOG.md` - [x] If a limitation was resolved, the "Known limitations" / "What works today" section in the relevant docs is updated - [x] If a new limitation was introduced, it is documented in the PR body and in-code - [x] Commit messages describe WHAT changed and WHY, not "fix things" or "updates" - [x] No emojis in code, docs, or commit messages - [x] No private paths, personal email addresses, or internal jargon in committed files - [ ] If this is a reverse-engineering finding: a reproducible probe under `probes/examples/` and a dated addendum to `docs/rvt-moat-break-reconnaissance.md` are included No changelog fragment, as with #1239: a speed-up within a release that already states the slowdown, for the 0.12.1 notes to give against 0.11.0. Not a reverse-engineering finding. ## Legal and contribution hygiene - [x] I agree this work is licensable under Apache-2.0 (see `CONTRIBUTING.md`) - [x] This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content (see `CLEANROOM.md`) - [x] Any new test fixtures use synthetic values (`testuser`, `111111`, `FY-20XX`, etc.) and contain no real-world PII ## Breaking changes None. No public signature changes. `read_defined_values` leaves `target_name` unfilled for a type no element of `ids` names, as its doc now says. ## Screenshots or output samples N/A: no output changes (byte-identical, above). ## Related issues Refs #1237 --------- Co-authored-by: DrunkOnJava <[email protected]>
15 of 17 tasks
DrunkOnJava
added a commit
that referenced
this pull request
Nov 4, 2026
…time, byte-identical (#1237) (#1333) ## Summary Exports of Revit 2015 to 2023 files take 0.54 to 0.78 of the time they took on `main`, and all 111 exports of the unfiltered Measure (every Measure model: the offices, Core Interior, R2025, the held-out models and the samples of every year, run 41793618569) are byte-identical, IFC and diagnostics. Against 0.11.0 they now take 1.09 to 1.65 times as long, where 0.12.0 took 2.0 to 3.4 times. The cuts are in what the native passes read, not in what they decide. ## Motivation #1237: 0.12.0 added native record passes on Revit 2015 to 2023 and exports took 2 to 3.4 times as long. #1239, #1240, #1275 and puzzbobb's #1301 took off the first part (the definitions read once, no family or material records in the named-parameter read, no per-record digest, the decoder borrowing the schema, and only the types the elements name). This takes the next part. The stages that cost the time were measured first, with a timing line on each native pass and each export step (scratch commits, archived below), on the 33 sample projects of 2015 to 2023. ## What the profile found Autodesk's 2015 `rac_advanced`, whose export `main` takes 2.8 s on a quiet runner and 0.11.0 0.7 s. The profile runs export many files at once on one runner, so milliseconds are not comparable between the two runs; each step's share of its run's export is. | step | before (Measure 41777773390) | share | after the first three commits (41781975396) | share | |---|---:|---:|---:|---:| | parameter definitions pass | 560 ms | 13% | 236 ms | 13% | | named-parameter read: elements | 948 ms | 22% | 56 ms | 3% | | named-parameter read: types | 72 ms | 2% | none | | | phase read of every record | 485 ms | 11% | 284 ms | 16% | | wall records and wall types | 341 ms | 8% | 193 ms | 11% | | whole export | 4,251 ms | | 1,775 ms | | - The named-parameter read decoded 5,608 records and 6 of them held the id of a definition it reads (`ids=5608`, `decoded=5608`, `hits=6`, 646 of its 647 ms decode on records with none). It checked 64 accepted definitions in the file; none is named `IsExternal`, so no type value could be used and the 72 ms type read was never needed. A scratch check that every record contributing a parameter holds an id found 0 exceptions in all 33 samples (`violations 0`; in 2015 `rme_advanced`, 516 of 6,724 records hold one). - The phase read decodes the Element base of all 17,099 records of 2015 `rac_advanced`; `decode_base` was 425 of its 485 ms, mostly a scan of every class for the name `Element` and a JSON object for each of 20 fields and 17 nested objects. - The definitions pass decodes 400 `FamilySymbol` records for 117 ms, for two root fields. See "What remains". ## Changes - `src/research/native_parameters.rs`: the graph decoder builds a class's field keys once for each class a record uses (a `ClassPlan`, kept per decode), copies no `Field` for the items of a container, and keeps field spans only for the caller that reads one (`Spans`, `decode_object_fields_spanning`). - `src/research/schema_registry.rs`: `Registry::named` finds a class through an index built on first use, not by scanning every class. - `src/research/native_element.rs`: `decode_base` reads the Element base fields straight from the bytes where the schema has the layout its checks measured, and by the graph decoder, as before, for anything else (a field with flags, a class with a parent of its own, an unknown pointer class, a flag above 1, more than 1,024 constraint references, a short body). - `src/research/native_document.rs`: `Options::filtered_parameters_only`, which with `definition_filter` leaves out a selected record whose body does not hold the first four bytes of the id of any definition the filter accepts. It assumes a value is saved against its definition's id itself, a whole little-endian integer in the record (an `Identifier`: 4 bytes on 2015 to 2023, 8 from 2024), so that a record without the integer's first four bytes holds no value for the definition. That is measured, not proven: on the 33 samples of 2015 to 2023 every record that gave an accepted parameter held an id, and the exports of every Measure model are unchanged with the filter (run 41793618569, 111 exports). The definitions pass also asks once for each class tag whether it owns a definition. - `src/research/native_element_parameters.rs`, `src/research/partition_schema_mvp/parameters.rs`: `read_property_values` replaces `read_defined_values`. It reads the types the elements name only if a definition the reader takes a type value for (a plain `IsExternal`) exists; otherwise the read is as before, and so is the read on a file that defines one. - `changelog.d/changed/1237-native-pass-cuts.md`. ## Testing Unit tests are banned in this repository: none added. The change is shown on real files, end to end. - [ ] `tools/check-local.sh`: nothing is built on this Mac (no local compute); CI's fast jobs run the draft, the full set runs when it is marked ready. - [x] Verified end to end on Autodesk's sample projects, with the offices, Core Interior, R2025 and the held-out models for the exports (the unfiltered Measure, run 41793618569), and 58 samples of 2015 to 2027 for the Element base reader (fetched for the run by `tools/fetch-autodesk-samples.sh`, never stored; terms in `research/autodesk-sample-projects.tsv`). The exports are compared with `main`'s: no Revit export is the oracle, since the change is meant to leave every value as it was. - [x] Byte identity: `ifc.sha256` and `diagnostics.json` of all 111 exports of the unfiltered Measure (`-f base=main -f nordic=true -f r2025=true -f samples=true -f holdout=true -f timing=true`, every scorer; run 41793618569, the merged head ea69551 against `main` at 2bfccab, every job succeeded) equal `main`'s, 111 of 111: 30 models including R2025, the 4 office files, 19 held-out models and 58 samples. Earlier, the 33 samples of 2015 to 2023 at 0fdfd49 (run 41780471217) and at 6f387fd (run 41782871819). - [x] The Element base reader against the graph decoder, on every record the phase read decodes (scratch commit archived at `refs/archive/2026-11-04/scratch/1237-timings-3`, Measure 41782852434, samples 2015 to 2027): 1,014,473 records compared by their full `ElementBase` (pointers, offsets, ids, flags, `end`), 0 differences, 0 fallbacks, all 58 exports exit 0. That branch's `read_base` is byte-identical to this head's: a diff of `src/research/native_element.rs` between the two shows only the comparison lines. - [x] Time: Measure's `timing` job, the median of three exports each, alternating order: the merged head ea69551 against `main` at 2bfccab on one runner (run 41793618569), and 6f387fd against v0.11.0 on another (run 41782874568); compare ratios, not seconds, between the two runs. - [x] The witness verdicts replay: Core Interior's export is byte-identical to `main`'s in run 41793618569, so its observations do not change. - [ ] `tools/bench.sh`: not rerun. It times `rvt-info`, `rvt-schema`, `rvt-history` and `rvt-analyze` on the family corpus, none of which runs these passes, and rewrites `docs/data/bench-2024.*`. Reproduce, naming the commit (the workflow comes from `main`): ```bash gh workflow run measure.yml --ref main -f ref=ea69551f0cd4ac8a601547a61d7c718963904a1f -f base=main -f nordic=true -f r2025=true -f samples=true -f holdout=true -f timing=true gh workflow run measure.yml --ref main -f ref=6f387fd1155ed6ad1af3aed784c49c6926545e19 -f base=main -f samples=true -f sample_years="2015 2023" -f models="-" -f scorers=none -f timing=true gh workflow run measure.yml --ref main -f ref=6f387fd1155ed6ad1af3aed784c49c6926545e19 -f base=v0.11.0 -f samples=true -f sample_years="2015 2023" -f models="-" -f scorers=none -f timing=true ``` ### Time, this change against `main` and against 0.11.0 Against `main`: the merged head ea69551, the `timing` job of run 41793618569 (one runner for every file, the median of three exports each, base and head in turn). Against 0.11.0: 6f387fd in run 41782874568, on a runner of its own. Totals of the medians; compare ratios, not seconds, between the two runs. | group | files | `main` (s) | this PR (s) | PR / `main` | peak memory, PR / `main` | PR / 0.11.0 (run 41782874568) | |---|---:|---:|---:|---:|---:|---:| | samples 2015 | 6 | 17.6 | 10.9 | 0.62 | 0.87 to 0.97 | 1.49 | | samples 2016 to 2018 | 9 | 16.8 | 11.0 | 0.66 | 0.86 to 0.99 | 1.51 | | samples 2019 to 2022 | 15 | 35.4 | 23.0 | 0.65 | 0.84 to 0.98 | 1.47 | | samples 2023 | 3 | 7.4 | 5.1 | 0.69 | 0.96 to 0.99 | 1.13 | | samples 2024 to 2027 | 25 | 218.5 | 187.1 | 0.86 | 0.90 to 1.00 | | | reference models and 4 offices | 10 | 71.8 | 60.9 | 0.85 | 0.93 to 1.04 | 0.80 to 0.98 (the 6 reference models) | The issue's table for 0.12.0 against 0.11.0 (run 41228075400) was 3.37 for 2015, 2.9 to 3.0 for 2016 to 2018, 2.8 to 3.2 for 2019 to 2022 and 2.01 for 2023. Per sample, PR / `main` is 0.54 to 0.78 for 2015 to 2023 and 0.80 to 0.89 for 2024 to 2027; PR / 0.11.0 is 1.09 to 1.65 for 2015 to 2023. Over all 33 samples of 2015 to 2023 it is 1.43. | sample | `main` (ms) | PR (ms) | PR / `main` | PR / 0.11.0 | |---|---:|---:|---:|---:| | 2015 rac_advanced | 2,764 | 1,644 | 0.59 | 1.65 | | 2015 rac_basic | 1,662 | 1,279 | 0.77 | 1.26 | | 2015 rme_advanced | 5,242 | 3,285 | 0.63 | 1.50 | | 2015 rme_basic | 4,767 | 2,899 | 0.61 | 1.48 | | 2015 rst_advanced | 1,971 | 1,069 | 0.54 | 1.54 | | 2015 rst_basic | 1,161 | 701 | 0.60 | 1.58 | | 2019 rac_advanced | 2,892 | 1,758 | 0.61 | 1.51 | | 2019 rac_basic | 1,673 | 1,278 | 0.76 | 1.28 | | 2019 rme_advanced | 5,188 | 3,361 | 0.65 | 1.46 | | 2019 rme_basic | 4,748 | 2,984 | 0.63 | 1.48 | | 2019 rst_advanced | 1,943 | 1,155 | 0.59 | 1.47 | | 2019 rst_basic | 1,113 | 691 | 0.62 | 1.52 | Reference models and offices, PR / `main`: 0.84 Core Interior, 0.85 and 0.85 the two office files (30.3 s to 25.7 s and 27.0 s to 22.9 s), 0.86 and 0.84 the two terrain files, 0.87 RE1 Architecture, 0.83 Electrical, 0.86 Mechanical, 0.85 Plumbing, 0.75 Einhoven. Peak memory is 0.93 to 1.04 of `main`'s; Core Interior is the 1.04 (309 to 322 MiB), against 1.01 in run 41782871819, which had `main` before #1329. The Element base reader's own effect: 2015 `rac_advanced` went from 0.73 to 0.63 of `main`'s time and `rst_basic` from 0.83 to 0.63 between runs 41780471217 (without it) and 41782871819 (with it), where the whole export is 1.8 s and the phase read it replaces was 16% to 26% of that. ## What remains over 0.11.0 The remaining cost is 1.43 times 0.11.0's time over all 33 samples (1.49, 1.51, 1.47 and 1.13 by release group, single samples 1.09 to 1.65). The issue's done-when is met as written: the stages that cost the time are measured, each is cut, and the timing against 0.11.0 states what is left per release. The rest is tracked in #1335: the `FamilySymbol` definitions read, the wall records, what is left of the phase pass, and the preamble. The definitions pass's full `FamilySymbol` decode (117 ms of 1,775 on 2015 `rac_advanced`) is not cut here because a root-only read is not value-neutral. From the profile after the first three commits (2015 `rac_advanced`, 1,775 ms: definitions 236, wall records 173 of which the native preamble 45 and the first pass's record index 23, phase read 284 before the direct reader): - the parameter definitions pass decodes every `FamilySymbol` and `Family` record in full (117 and 18 ms), but reads two root fields of them (`m_id` and `m_familyId` or `m_categoryId`). A root-only read would ingest a record whose full decode fails and which the pass now skips, so `symbol_families` could differ. Not done, since it is not value-neutral; - the wall records' top joins and type ids read the `SWall` graphs (180 records, 700,000 values); - the preamble (schema, history, ElemTable, extensible-storage catalog) is read once, 45 ms. ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR: no capability changes; `docs/status.md` already says `main` is ahead by the fragments. - [x] A user-visible change has its entry as a fragment under `changelog.d/changed/`. - [x] Not applicable: no limitation resolved or added. The read of the parameters named for a property reads fewer records and the same values. - [x] Commit messages say what changed and why. - [x] No emojis in code, docs, or commit messages. - [x] No private paths, personal email addresses, or internal jargon in committed files. - [x] Not a reverse-engineering finding. ## Legal and contribution hygiene - [x] I agree this work is licensable under Apache-2.0 (see `CONTRIBUTING.md`). - [x] This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content (see `CLEANROOM.md`). - [x] No new fixtures. ## Breaking changes None to the stable API, the CLIs or any export (every Measure model, run 41793618569, 111 exports). `rvt::research` (unstable): `native_element_parameters::read_defined_values` is replaced by `read_property_values`; `native_document::Options` gains `filtered_parameters_only`; `native_parameters` gains `Spans` and `decode_object_fields_spanning`; `schema_registry::Registry` gains a private field (it is built only by `parse`). ## Screenshots or output samples N/A: IFC and diagnostics are byte-identical (above; every Measure model, run 41793618569, 111 exports). ## Related issues Closes #1237. Refs #1335, which tracks the remaining cost over 0.11.0. Credit to puzzbobb for #1301, which this goes on from, and for naming the same costs (the schema copy, the types decoded and never used, the per-record digest) in #1237's step-level profile. The profiling commits are archived at `refs/archive/2026-11-04/scratch/1237-timings` (bb0c048, per-pass timing and the check that a contributing record holds a definition's id), `1237-timings-2` (1187a65, the profile after the first three commits) and `1237-timings-3` (a57e12a, the Element base comparison).
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.
Part of #1237, which reports that 0.12.0 exports Revit 2015 to 2023 files 1.6 to 3.9 times as slowly as 0.11.0.
Profile. A scratch branch logged each native pass's caller and time (Measure 41240110248 and 41241242631; the branch is kept at
refs/archive/2026-10-31/scratch/1237-pass-timings).native_document::extractruns twice: once for the parameters named for a property (partition_schema_mvp/parameters.rs) and once for storeys'EntranceLevel(ifc/storey_properties.rs).rac_advanced, 857 to 929 ms on 2019rme_advancedand 452 to 473 ms on 2023rac_advanced.Change. The definitions, units, bindings and per-owner diagnostics of that pass are a
DefinitionPass. The handle keeps it, keyed by the options the pass depends on: its three budgets,graph_classesandreleases. It sets the channel and clears the selections itself. A laterextractwith the same options reuses it, and an error is not kept.Measured (41242862076, against
7cf5318b, one runner, median of three alternating runs per file):extractthere).rme_basic+35 MiB, 2015rme_basic+23 MiB), because the registry stayed alive for the handle's lifetime.Second version (fd98776).
definition_passnames everyOptionsfield, so a new field has to be put in the key or left out of it on purpose.Measured again (41247003218, same method):
rme_basicincluded (633 MiB both).rme_basic, 361 MiB to 386 MiB (+7%). On a 2015 to 2023 file the registry lives from the named-parameter read to the storeys' read, and that file peaks in between.No changelog fragment: this is a speed-up within a release that already states the slowdown. The 0.12.1 notes will give the measured result.