Skip to content

Commit

Permalink
No longer track partially commited element references (#206)
Browse files Browse the repository at this point in the history
Tracking each unresolved reference to be able to resolve it as soon as
possible has a big impact on memory consumption when there are large
amounts of pending references.
One such case is multiple display styles with hundreds of thousands of
excluded elements.

The transformer now only keeps track of element and aspect ids that were
only partially completed. These elements and aspects will be reprocessed
once all the elements have been processed by the transformer. The only
unresolvable references at that point will be the elements that were
intentionally filtered out by the transformer or the invalid ones.

---------

Co-authored-by: Nick Tessier <[email protected]>
  • Loading branch information
ViliusRuskys and nick4598 authored Oct 1, 2024
1 parent 71b909d commit e6ac567
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 331 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "no longer track partially commited element references",
"packageName": "@itwin/imodel-transformer",
"email": "[email protected]",
"dependentChangeType": "patch"
}
4 changes: 3 additions & 1 deletion packages/transformer/src/IModelExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ export abstract class IModelExportHandler {
return true;
}

/** Called when element is skipped instead of exported. */
/** Called when element is skipped instead of exported.
* @note When an element is skipped, exporter will not export any of its child elements. Because of this, [[onSkipElement]] will not be invoked for any children of a "skipped" element.
*/
public onSkipElement(_elementId: Id64String): void {}

/** Called when an element should be exported.
Expand Down
Loading

0 comments on commit e6ac567

Please sign in to comment.