Environment
- vim-web
1.0.0-alpha.0, IIFE build (dist/vim-web.iife.js) loaded via <script>
- API:
VIM.Core.Webgl.createViewer() (headless, custom UI)
- Chromium / desktop, devicePixelRatio 1.75
- Model: 2,547 elements (2,264 with geometry), 12 Revit categories, structural
Summary. The documented per-element path (element.getBimElement()) is fine for a handful
of elements but pathological for whole-model work. Reading the BIM tables in bulk is ~3 orders
of magnitude faster.
Measured (2,264-element model, same machine):
// Per element — the "obvious" path
await Promise.all(els.slice(0,100).map(e => e.getBimElement())); // >30s, timed out ❌
// Bulk — via the VimDocument tables
await Promise.all([
vim.bim.element.getAllName(),
vim.bim.element.getAllCategoryIndex(),
vim.bim.element.getAllFamilyName(),
vim.bim.element.getAllId(),
vim.bim.category.getAllName(),
]); // ~13ms for the whole model ✅
// map with el.element (BIM index): names[el.element], catNames[catIdx[el.element]], …
Asks.
- Document the bulk
vim.bim.<table>.getAll*() pattern as the recommended approach for
iterating many elements, and call out that getBimElement()/getBimParameters() are
per-element conveniences not meant for full-model loops.
- Consider a batched
vim.getBimElements(indices?) that resolves an array in one pass.
Environment
1.0.0-alpha.0, IIFE build (dist/vim-web.iife.js) loaded via<script>VIM.Core.Webgl.createViewer()(headless, custom UI)Summary. The documented per-element path (
element.getBimElement()) is fine for a handfulof elements but pathological for whole-model work. Reading the BIM tables in bulk is ~3 orders
of magnitude faster.
Measured (2,264-element model, same machine):
Asks.
vim.bim.<table>.getAll*()pattern as the recommended approach foriterating many elements, and call out that
getBimElement()/getBimParameters()areper-element conveniences not meant for full-model loops.
vim.getBimElements(indices?)that resolves an array in one pass.