core-interop: SchemaView-based ECSchemaProvider#1394
Conversation
🦋 Changeset detectedLatest commit: 2170ba7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
| Test | Baseline | SchemaView |
|---|---|---|
| compute selection for 50k elements | 297 ms | 263 ms (-11.4%) |
| compute parent selection for 50k elements | 294 ms | 279 ms (-5.1%) |
| compute top ancestor selection for 50k elements | 455 ms | 447 ms (-1.8%) |
| compute category selection for 50k elements | 93 ms | 95 ms (+2.2%) |
| compute model selection for 50k elements | 75 ms | 64 ms (-14.7%) |
| compute functional selection for 50k 3D elements | 371 ms | 375 ms (+1.1%) |
| compute parent functional selection for 50k 3D elements | 392 ms | 358 ms (-8.7%) |
| compute top ancestor functional selection for 50k 3D elements | 908 ms | 857 ms (-5.6%) |
| compute functional selection for 50k 2D elements | 2280 ms | 2349 ms (+3.0%) |
| compute parent functional selection for 50k 2D elements | 2258 ms | 2318 ms (+2.7%) |
| compute top ancestor functional selection for 50k 2D elements | 2254 ms | 2440 ms (+8.3%) |
| hilite 50k elements | 1500 ms | 1447 ms (-3.5%) |
| hilite 50k group elements | 212 ms | 204 ms (-3.8%) |
| hilite 1k subjects | 30247 ms | 29331 ms (-3.0%) |
| hilite 50k subcategories | 250 ms | 210 ms (-16.0%) |
| hilite 50k functional 3D elements | 23000 ms | 21614 ms (-6.0%) |
| hilite 50k functional 2D elements | 5765 ms | 5257 ms (-8.8%) |
TLDR; More or less within error.
Hierarchies
| Test | Baseline | SchemaView |
|---|---|---|
| grouping by label | 19551 ms | 21177 ms (+8.3%) |
| grouping by class | 22408 ms | 21111 ms (-5.8%) |
| grouping by property | 21950 ms | 21654 ms (-1.3%) |
| grouping by base class (10 classes) | 68486 ms | 70980 ms (+3.6%) |
| grouping by multiple attributes | 98992 ms | 101764 ms (+2.8%) |
| models tree initial (Baytown) | 81 ms | 156 ms (+92.6%) |
| models tree full (Baytown) | 87322 ms | 45069 ms (-48.4%) |
| models tree creates initial filtered view for 50k target items | 4087 ms | 4224 ms (+3.4%) |
| hide if no children required to finalize root, w/o children | 33225 ms | 29413 ms (-11.5%) |
| hide if no children required to finalize root, w/ children | 189 ms | 111 ms (-41.3%) |
| search searches with 50000 paths | 8514 ms | 8633 ms (+1.4%) |
| flat 50k elements list | 4933 ms | 4227 ms (-14.3%) |
TLDR; Most within error, except 1 significant improvement - "models tree full (Baytown)" (87322 ms -> 45069 ms),
Next, I'll try this implementation on our real-world iModels using Models tree & Consolidated content descriptor tests.
Presentation performance tests: local backendLocal backend means it's running in a process on the same machine and has iModel fully available (no need to download any V2 checkpoint blocks). Comparison of median local run times between TS Consolidated content descriptor
Summary: Models tree initial load
Summary: The aggregate grows from 8.94 s to 14.93 s (+67%). The split is 22 faster / 17 slower. Wins are concentrated in small/medium models and a couple of XL models that do little first-load work ( Models tree first branch
Summary: The suite is essentially at parity — the aggregate edges down from 260.88 s to 250.21 s (-4.1%, or -9.3% excluding the dominant OverallThe content-descriptor suite clearly favors |
Presentation performance tests: remote backendComparison of remote run times between TS Consolidated content descriptor
Summary: Models tree initial load
Summary: Mixed result, aggregate up from 64.64 s to 80.25 s (+24.2%), split 24 faster / 18 slower. Models tree first branch
Summary: Net win for OverallAgainst the remote backend the content-descriptor suite is a decisive |
SchemaContext vs SchemaView — remote comparisonTestsSchemaContext const schemaContext = connection.schemaContext;
const schema = await schemaContext.getSchema(new SchemaKey("BisCore"));
await schema?.getEntityClass("Subject");
await schema?.getEntityClass("PhysicalModel");
await schema?.getEntityClass("SpatialCategory");
await schema?.getEntityClass("GeometricElement3d");SchemaView const schemaView = await connection.getSchemaView();
schemaView.findClass("BisCore.Subject");
schemaView.findClass("BisCore.PhysicalModel");
schemaView.findClass("BisCore.SpatialCategory");
schemaView.findClass("BisCore.GeometricElement3d");Results
Summary
|
|
To conclude, as much as I'd like to move forward with cc @rschili |
I see. That said, there is also always the option of using ECSql. I would not recommend going for ECSql for everything, but if this is an isolated area/scenario in your code where it is an option, and you only need a few queries - it should work nicely. Do you want to explore that? You gave me food for thought about SchemaView anyways, since it performs so well in some scenarios, I kind of want to improve it no matter what you end up choosing. |
|
I had a look at how this branch consumes Filter/Subset: How your adapter can consume it: your Two things to watch:
My PR is still just a draft, I need to polish it some more. IModelConnection does not have the filter yet, I want to nail it on the backend implementation first. But I expect I can get this done within the week. |
No description provided.