iTwin / presentation

Monorepo for iTwin.js Presentation Library
https://www.itwinjs.org/presentation/
MIT License
5 stars 0 forks source link

Update modelsTreeDefinition from viewer-components-react #770

Closed JonasDov closed 2 weeks ago

JonasDov commented 3 weeks ago

Changes from viewer-components-react: https://github.com/iTwin/viewer-components-react/pull/1084

changeset-bot[bot] commented 3 weeks ago

⚠️ No Changeset found

Latest commit: 3d37a7d3d54ebabc86d2cce3d97c3dfd5b15f627

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

github-actions[bot] commented 3 weeks ago

Hierarchies benchmark

Benchmark suite Current: 3d37a7d3d54ebabc86d2cce3d97c3dfd5b15f627 Previous: 50ecb9c914a1b788581b99fe2e754fc078535567 Deviation Status
flat 50k elements list 4763.89 ms 4755.25 ms 0.1817% 🚨
flat 50k elements list (P95 of main thread blocks) 81 ms 75 ms 8% 🚨
filtering filters with 50000 paths 14146.35 ms 14140.73 ms 0.0397% 🚨
filtering filters with 50000 paths (P95 of main thread blocks) 128 ms 133 ms -3.7594%
grouping by label 11052.57 ms 11006.08 ms 0.4224% 🚨
grouping by label (P95 of main thread blocks) 71 ms 73 ms -2.7397%
grouping by class 11016.75 ms 11179.76 ms -1.4581%
grouping by class (P95 of main thread blocks) 48 ms 43 ms 11.6279% 🚨
grouping by property 11581.3 ms 11742.68 ms -1.3743%
grouping by property (P95 of main thread blocks) 58 ms 56 ms 3.5714% 🚨
grouping by base class (10 classes) 8318.73 ms 8301.96 ms 0.2020% 🚨
grouping by base class (10 classes) (P95 of main thread blocks) 67 ms 72 ms -6.9444%
grouping by multiple attributes 29009.76 ms 29330.47 ms -1.0934%
grouping by multiple attributes (P95 of main thread blocks) 45 ms 40 ms 12.5000% 🚨
hide if no children required to finalize root, w/o children 51431.96 ms 51381.18 ms 0.0988% 🚨
hide if no children required to finalize root, w/o children (P95 of main thread blocks) 30 ms 31 ms -3.2258%
hide if no children required to finalize root, w/ children 188.13 ms 177.74 ms 5.8456% 🚨
hide if no children required to finalize root, w/ children (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨
models tree initial (Baytown) 40.77 ms 43.42 ms -6.1032%
models tree initial (Baytown) (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨
models tree full (Baytown) 7777.38 ms 7827.12 ms -0.6355%
models tree full (Baytown) (P95 of main thread blocks) 88 ms 86 ms 2.3256% 🚨
models tree creates initial filtered view for 50k target items 2403.55 ms
models tree creates initial filtered view for 50k target items (P95 of main thread blocks) 340 ms

This comment was automatically generated by workflow using github-action-benchmark.

JonasDov commented 2 weeks ago

Do you think it would be possible to add a performance test that highlights this improvement? We already have some "models tree" tests, so should be just a matter of using a larger dataset and coming up with a list of target instance keys (maybe just query all geometric element ids to get that list?)

Added a performance test and tested it with new implementation and old implementation. These are the results when running locally: Number of target items Original implementation (time for initial load of tree) New implementation (time for initial load of tree)
500 33.38 s 172 ms
50k ? 1.73 s