Skip to content

Default saved meshes: peak memory is 1.4 to 4.4 times 0.17.0's on Revit 2023 to 2027 files, where #1191 measured up to 1.6 #1690

Closed

Description

@DrunkOnJava

The default export of a Revit 2023 to 2027 file takes 1.4 to 4.4 times the peak memory it took in 0.17.0 (and up to 2.1 times the time), far above the 1% to 17% and up to 59% that #1191 reported.

Measure run 42949360321 (main at 8334726 against v0.17.0, every file timed on one runner, three rounds, rvt-ifc default options). Peak memory, MiB, v0.17.0 to main:

file time peak
Snowdon Towers Architectural (2024) 17.4 s to 27.4 s 1,072 to 3,964 (3.7x)
BIM4LCA office, concrete, as built 17.0 s to 21.9 s 914 to 2,050 (2.2x)
BIM4LCA office, concrete, permit 14.1 s to 18.2 s 973 to 2,089 (2.1x)
Core Interior (2024) 3.4 s to 4.0 s 305 to 647 (2.1x)
rac_basic 2023 (a 5 MB sample) 1.5 s to 3.2 s 200 to 874 (4.4x)
Revit 2015 to 2022 samples (30) 0.97 to 1.02x 1.00x
Revit 2023 to 2027 samples (28) 1.13 to 2.12x 1.42 to 4.37x

#1191's own measurement (Measure run 42614230465) read Core Interior at 305 MiB and the office as built at 1,423 MiB, so the growth is after #1191.

Where it came in. Core Interior's peak at the commits of main since 0.17.0 (timing runs 42952619021 and the six after it): 305 MiB at cbeba4c (#1191), 66b7186 (#1612) and d735407 (#1624), 647 MiB from 5dd8a3a (#1620) on, so it is one of the four commits between (a8a126f, #1629, the walls' quantities; 84e6994, family revolutions; 45cdcd4, the panels' width; 5dd8a3a). The walls are the candidate: since RE-388 the pass reads the saved graphics of every wall, whether or not its body is a box, and extract_in_batches_with_control reads every owner's graph first and holds all of them until its batch is meshed, a wall's graph being about 1.6 MiB (#1429) and Core Interior's walls 351.

The change. Read each owner once for what its graph names and how large it is, let it go, and read it again with the batch it is meshed in, with the owners that name no symbol batched by their graph objects like the symbols are. It changes no body, so every export must be byte-identical to main's; the cost is one more read of the owners' records per batch.

Not a reason to take the default away: --no-saved-meshes returns 0.17.0's memory, and the notes for 0.18.0 say what the default costs.

Activity

  1. added
    area:geometry
    area:ifc
    priority:P1
    type:bug
    on Nov 11, 2026
  2. DrunkOnJava commented on Nov 11, 2026

    @DrunkOnJava
    OwnerAuthor

    The change and the rows registered before its run.

    fix/saved-mesh-owner-memory (7b96203, src/research/native_saved_scene.rs only) reads each owner once for what its graph names and how large it is, lets it go, and reads it again with the batch it is meshed in; owners that name no symbol are batched by their graph objects (20,000, about 95 MiB, like the symbols). It is meant to change no body. The run: unfiltered Measure of that head against main at 8334726, every flag, with timing.

    1. All 126 exports are byte-identical to main's (ifc.sha256) and every diagnostics.json is equal: the pass draws the same bodies, whatever the batches.
    2. Core Interior's peak falls from 647 MiB to 400 MiB or less (0.17.0: 305).
    3. The BIM4LCA office as built falls from 2,050 MiB to 1,500 or less, and Snowdon Towers Architectural from 3,964 to 2,500 or less (0.17.0: 914 and 1,072).
    4. The time rises by no more than 10% on Core Interior and 15% on the office as built over main's, the cost being a further read of the owners' records per batch.
    5. The 30 sample projects of Revit 2015 to 2022 are unchanged in time and peak (they read no saved graphics).

    If 1 fails the batching changes a mesh and the change is narrowed or dropped; if 2 or 3 miss, the memory is not (only) the owners' graphs and the next row names what the run shows.

  3. DrunkOnJava commented on Nov 11, 2026

    @DrunkOnJava
    OwnerAuthor

    The bisect names the commit: #1629 (RE-388, a wall's quantities from its saved mesh).

    Core Interior's peak at each commit of main since 0.17.0, timed on one runner against v0.17.0 (timing runs 42952619021, 42952628225, 42952637327, 42953219936, 42953229999, 42952647239, 42952656378, 42952666019, 42952674843):

    commit peak MiB (0.17.0: 305)
    cbeba4c (#1610, #1191's default) 305
    66b7186 (#1623, #1612's roofs) 305
    d735407 (#1626, #1624's stair railings) 305
    a8a126f (#1629, RE-388) 646
    45cdcd4 (#1637, RE-396) 647
    5dd8a3a (#1620) 647
    15767c3, 74a5034, 134db97 647

    So the walls are the cause, as the candidate said: since #1629 the pass selects every wall (walls in attach_scoped_with_control) whether or not its body is a box, and extract_in_batches_with_control read all the owners' graphs first and kept them to the end. The change on fix/saved-mesh-owner-memory is its answer; its unfiltered Measure with timing is run 42953729057.

  4. DrunkOnJava commented on Nov 11, 2026

    @DrunkOnJava
    OwnerAuthor

    The design changed after rvtDevelop's read; rows 1 to 5 stand, one added. Run 42953729057 (the first design) is cancelled.

    Reading owners again per batch costs one extract_graphs walk per batch (each call parses every group of every partition that holds a selected id), about 30 more walks on Snowdon Towers Architectural, and decodes each wall twice. fix/saved-mesh-owner-memory at 8cf93e9 instead lets go, after the first read, the owners that name nothing and that no owner names (the walls), and reads them again in one pass whose callback meshes a buffer of 20,000 graph objects at a time; the batches see only owners that name symbols or owners, kept as before. The cost is one walk and one more decode of those owners.

    Rows 1 to 5 as registered above. Added:

    1. Snowdon Towers Architectural's time is no more than 15% over main's (27.4 s) and the office as built's no more than 15% over main's (21.9 s): the first design could have turned the memory regression into a time one, this one should not.

    The run: unfiltered Measure of 8cf93e9 against main at 8334726, every flag, with timing.

  5. DrunkOnJava commented on Nov 11, 2026

    @DrunkOnJava
    OwnerAuthor

    Result of Measure 42954375538 against the rows: rows 1, 3, 4, 5 and 6 held, row 2 missed (Core Interior 437 MiB, not 400); the remainder against 0.17.0 is #1694.

    #1691's head 8cf93e9 against main at 8334726, unfiltered, every flag, timed on one runner per file (126 models each side).

    1. Held. 0 of 126 exports move (ifc.sha256) and no diagnostics.json line differs: the pass draws the same bodies, and the entity numbering of the property sets it appends did not move on any model.
    2. Missed. Core Interior's peak falls from 647 to 437 MiB, not to 400 or less (0.17.0: 305).
    3. Held. The BIM4LCA office as built falls from 2,051 to 1,432 MiB (registered 1,500 or less; permit 2,090 to 1,545) and Snowdon Towers Architectural from 3,960 to 2,099 (2,500 or less; 0.17.0: 914 and 1,072).
    4. Held. Time on Core Interior 4.54 s to 4.62 s (+2%) and on the office as built 34.4 s to 35.6 s (+3%; this runner is slower than the baseline's).
    5. Held. The 30 samples of Revit 2015 to 2022: time 0.98 to 1.03 times, peak 1.00.
    6. Held. Snowdon Towers Architectural 29.3 s to 30.1 s (+2%), the office +3%.

    Also: the 28 samples of Revit 2023 to 2027 read 0.97 to 1.04 times in time and 0.53 to 1.05 times in peak (Snowdon Towers Structural rises 469 to 495 MiB, the one file that does: the buffer), the 10 reference models 1.00 to 1.06 and 0.68 to 1.01. full / CI passed, the same-project gates and the semantic diff are green on 8cf93e9.

    What it leaves. Against 0.17.0 the peak is still 1.4 times on Core Interior (305 to 437), 1.6 on the office as built, 2.0 on Snowdon Architectural, and 4.4 on the small samples of 2023 to 2027 (rac_basic 2023: 200 to 875 MiB, which this change did not move). The part that is not the owners' graphs is #1694. The 0.18.0 notes state both tables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:geometryarea:ifcpriority:P1type:bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions