Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Optimize creating subjects hierarchy in Models Tree #3671

Merged
merged 2 commits into from
May 25, 2022

Conversation

grigasp
Copy link
Member

@grigasp grigasp commented May 24, 2022

We create nodes for Models only if they have elements. If a GeometricModel has an element, it means it definitely has a child node of a Category instance. Put a hint for this so we don't have to run a query to check what we already know.

This makes a huge difference for the initial Models Tree load performance, because we don't need to run the slow Models-to-Categories queries. Local run on the performance test suite:

Before (s) After (s)
5.217 0.774
4.037 0.263
2.3635 0.421
3.016 0.355
6.0315 0.414
2.0585 0.374
0.726 0.393
0.7 0.432
0.2775 0.171
0.302 0.226
1.819 0.391
1.756 0.607
0.21 0.215
5.7805 1.545
0.2285 0.165
0.167 0.167
0.585 0.23
0.352 0.226
0.578 0.243
0.261 0.225
0.6225 0.376
0.251 0.187
0.228 0.143
0.181 0.163
0.203 0.186
0.2 0.183
0.2335 0.19
0.201 0.175
0.201 0.165
0.191 0.171
18.0665 0.997
10.8725 0.558
7.9495 2.021
461.814 26.862
8.979 1.458
8.8035 1.045
2.2795 0.279
0.398 0.367

A change in the addon is also required for this to have effect: https://bentleycs.visualstudio.com/iModelTechnologies/_git/imodel02/pullrequest/251290

@grigasp grigasp requested review from a team as code owners May 24, 2022 15:13
@grigasp grigasp enabled auto-merge (squash) May 25, 2022 04:49
@grigasp grigasp merged commit 9ebf7af into imodel02 May 25, 2022
@grigasp grigasp deleted the ui/models-tree/optimize-creating-subjects-hierarchy branch May 25, 2022 06:02
pmconne added a commit that referenced this pull request Jun 21, 2022
* test native fixes for roundtripping placement when no geometry is present (#3642)

* move up equalWithFpTolerance and add test for placement geometry json roundtrip

* remove dead imports from development

* rush change

Co-authored-by: Michael Belousov <[email protected]>

* close transformer state dumps even if overrides threw an error (#3612) (#3656)

* close transformer state dumps even if producing them threw an error

Co-authored-by: Michael Belousov <[email protected]>

Co-authored-by: Michael Belousov <[email protected]>

* fix failing test due to (previous) rounding error in queryModelRange (#3675)

* UI: Optimize creating subjects hierarchy in Models Tree (#3671)

* Bump tile format version (#3732)

* Add support for CloudSqlite (#3747)

* work on cloud containers

* make workspace containers use CloudSqlite

* wip

* workspace editor with new CloudSqlite

* support CloudContainers for opening SQLiteDbs

* add tests for CloudSqlite

* test anonymous access

* add tests for using CloudCache guid for write locks

* work on download checkpoint

* more download testing

* allow creating and opening SQLiteDbs with params

* cloud workspace tests

* rework resolveContainerName

* add WorkspaceDb versioning

* fix tests

* lint errors

* enable checksums for block names

* add makeVersion command to WorkspaceEditor

* documentation cleanup

* documentation cleanup

* add --noPrompt for initializeWorkspace

* support "@" scripts

* fix package file

* cleanup

* don't allow writes to workspaceDbs unless they have been versioned in the current txn

* fix tests

* rename container.attach to container.connect

* fix tests

* add detach arg to disconnect

* separate detach and disconnect

* allow offline usage

* collate nocase for listDb

* add detach command to WorkpsaceEditor

* show "friendly" file sizes

* add version for testing cloud gcs

* renames for customuri api

* workspace settings

* checkForChanges is not async

* get tests working

* load extra gcs databases stored in iModel settings

* work on loading settings

* work on settings

* read all settings and schema files at startup

* fix tests

* old->newV2props, add test for daemon, start working on supporting v2checkpoint without daemon

* doc cleanup

* don't rename V2CheckpointAccessProps members

* fixes, Nick please review

* doc cleanup

* wip

* merge

* fix tests

* cleanup lint warnings

* Add some tests, more changes around cache / blockcache_dir

* doc

* Add two env variables, prefetchbeforeopen, prefetchafteropen for testing. add non null assertions to some failing tests

* wip

* lint errors

* fix tests

* validate settings against schema

* validate array entries

* validate setting schemas

* workspace documentation

* afds

* rename curl debugging option

* wip

* time prefetch

* make editor functions async

* workspaceEditor doc

* document @ scripts

* workspaceEditor doc

* @ script examples

* cleanup

* new sqlite code for prefetch

* prefetch testing

* cleanup

* add a PREFETCH_TIMe env variable

* make WorkspaceDb.prefetch return the prefetch object

* wip

* merge

* update @types/chai

* add prefetch_nrequests

* use parseSync for Yargs

* log time taken for prefetch always

* lint errors

* allow choosing nRequests for prefetch testing

* don't use env variables, switch to app settings to determine a prefetch

* improve prefetch logging

* lint errors

* cleanup

* allow importDb to supply extension for input file

* use CloudContainer.blockSize

* lint errors

* use https for gcs data url

Co-authored-by: nick.tessier <[email protected]>

* Fix requestElementGraphics (#3748)

* Add tests for `computeSchemaChecksum` (#3733)

* Functionality to generate sha1 hash for schema xml

* consuming iModelHost

* Adding static function to the schema class

* Made the hash generation as separate functionality due to circular import issue

* removed unnecessary import

* function name updated with lint fixes

* Moving changes to IModelHost

* Documentation removed

* combined test

* line space added back

* changelogs added

* Presentation: Avoid counting target instances when calling getContentDescriptor RPC operation (#3816)

* how about we avoid running rush update on imodel02 branch.

* fix up core-backend

* fix CheckpointManager test.

* Delete core-transformer's HubMock

Temporarily comment out TileCache tests.

* unused imports.

* fix TileCache.test.ts merge

* extract-api; doc TODOs

* lint

* invalid doc links.

* Fix presentation-backend test

* remove unncessary dependencies from map-layers-auth

* re-remove merge-restored removed deepEqualWithFpTolerance impl

* Lock down ts-node to 10.8.0 for now because istanbuljs/nyc#1473

* fix slash direction

* Lock superagent down to 7.1.3 because 7.1.6 has core-full-stack-test integration test failures in electron.

* String.replaceAll no existe.

* remove unnecessary pretest script that triggers an nyc bug

* fix test errors

* extract-api, lint

* remove temporary test setting for gcs

* fix lint error

Co-authored-by: Michael Belousov <[email protected]>
Co-authored-by: Michael Belousov <[email protected]>
Co-authored-by: NancyMcCallB <[email protected]>
Co-authored-by: imodeljs-admin <[email protected]>
Co-authored-by: Robert Lukasonok <[email protected]>
Co-authored-by: Caleb Shafer <[email protected]>
Co-authored-by: Arun George <[email protected]>
Co-authored-by: johnnyd710 <[email protected]>
Co-authored-by: Bill Steinbock <[email protected]>
Co-authored-by: Mark Schlosser <[email protected]>
Co-authored-by: Michel D'Astous <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: bbastings <[email protected]>
Co-authored-by: Arun George <[email protected]>
Co-authored-by: kckst8 <[email protected]>
Co-authored-by: AlainRobertAtBentley <[email protected]>
Co-authored-by: Alina Paliulionytė <[email protected]>
Co-authored-by: Alina Paliulionyte <[email protected]>
Co-authored-by: Daniel Toby <[email protected]>
Co-authored-by: kabentley <[email protected]>
Co-authored-by: Grigas <[email protected]>
Co-authored-by: nick.tessier <[email protected]>
Co-authored-by: naveedkhan8067 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants