Skip to content

Improve performance of the $select guidance #304

@waldekmastykarz

Description

@waldekmastykarz

We should implement the $select guidance on top of a local SQLite db to improve the performance of the $select guidance plugin.

In #302 we improved the accuracy of the $select guidance by using the Open API docs for Microsoft Graph v1.0 and beta. While using these files increases the accuracy of our guidance, it significantly affects the performance of the proxy. The Open API docs for Graph v1.0 and beta are large (~30MB) and loading them into memory takes ~15s and ~500MB of memory.

We can mitigate this performance hit, by using a local SQLite db with just the necessary information about Graph endpoints. Using the information from the Open API docs, we'd build a local SQLite db, with just the necessary information needed for the proxy. Early tests showed that the SQLite file would be roughly 1.5MB and take 20MB of memory, which is a huge improvement.

We'd implement this improvement as follows:

  • add a new subcommand to the proxy named msgraphdb (so to run it, you'd call m365proxy msgraphdb). This command, would download the latest Open API files for Graph v1.0 and beta and create the local SQLite db. Using this command would allow users to regenerate the local db
  • include a default version of the SQLite db with the proxy release which we refresh before each release so that the proxy has a proper out of the box experience
  • update the $select guidance plugin to use the local SQLite db

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions