The exporter (for better or for worse) will always run IModelDb.elements.getElement on all elements. The new polymorphic ECSQL query syntax SELECT $ FROM bis.Element allows us to use one query to get all the json that otherwise the iTwin.js native layer would produce. With some slight json post processing of the results of that query, we can call IModelDb.constructEntity with the props and the known class from the class registry, and get an element just as we would have if we called getElement directly, but through one query for all elements.
The attached branch has most of this done already, but performance analysis needs to be done on it, the current work isn't discernibly faster than the existing work, which indicates it may not be a bottleneck.
How to do faster INSERT/UPDATE (which should be more of a bottleneck) is another question that may require discussion with the ECDb maintainers.
The exporter (for better or for worse) will always run
IModelDb.elements.getElement
on all elements. The new polymorphic ECSQL query syntaxSELECT $ FROM bis.Element
allows us to use one query to get all the json that otherwise the iTwin.js native layer would produce. With some slight json post processing of the results of that query, we can callIModelDb.constructEntity
with the props and the known class from the class registry, and get an element just as we would have if we calledgetElement
directly, but through one query for all elements.The attached branch has most of this done already, but performance analysis needs to be done on it, the current work isn't discernibly faster than the existing work, which indicates it may not be a bottleneck.
How to do faster INSERT/UPDATE (which should be more of a bottleneck) is another question that may require discussion with the ECDb maintainers.