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

Investigate loading schemas incrementally via ECSql #6903

Open
ColinKerr opened this issue Jun 27, 2024 · 0 comments
Open

Investigate loading schemas incrementally via ECSql #6903

ColinKerr opened this issue Jun 27, 2024 · 0 comments
Labels
ecdb ECDb and ECSQL related issues ecschema Issues related to the various ecschema packages

Comments

@ColinKerr
Copy link
Member

ColinKerr commented Jun 27, 2024

@grigasp has run into performance issues when loading large schemas on the frontend for presentation: iTwin/presentation#601

Recent improvements have helped but for large schemas it's unlikely that an async incremental way to load schemas would improve startup time.

ecschema-metadata has the delayed promise abstraction around schema items but the implementation loads the entire schema at once. We should investigate an implementation that incrementally loads the schema using ECSql.

  1. schema key + reference schema keys - This is enough to return the SchemaInfo for a schema
  2. SchemaItem names - This is enough to create the schema item keys and hopefully construct the lazy loaded schema item
  3. chunks of schema item bodies - We don't want to make an HTTP call for each schema item, that would be too many calls even for a small schema. We can investigate a single query that loads all dependencies for a given item. Loading all base classes for a class is easy to do, but what about all other dependencies?

Goals of this investigation

  1. Is the current Lazy Load/DelayedPromise paradigm the correct one to use?
  2. Can we efficiently incrementally load schemas?
  3. Can we load enough to answer some important questions quickly then use other mechanisms to load the rest of the schema?
  4. Suggestion how to proceed
@ColinKerr ColinKerr added ecdb ECDb and ECSQL related issues ecschema Issues related to the various ecschema packages labels Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ecdb ECDb and ECSQL related issues ecschema Issues related to the various ecschema packages
Projects
None yet
Development

No branches or pull requests

1 participant