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

Autoload files on demand to avoid loading the whole library #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jrafanie
Copy link

@jrafanie jrafanie commented May 6, 2024

Modeled after: xlab-si/intersight-sdk-ruby#14

Note, this saves around 6 MB of memory by delay loading 214 files.

Future plugins could use useAutoload option to autoload. This was added in 6.1.0 of the openapi-generator:
OpenAPITools/openapi-generator#13153

Note, this library has non-standard class names, even within the same plugin, such as SDE capitalized in AutoSDEProject but not in AutosdeOpenapiClient. To workaround this, I had to validate that all classes we try to autoload can actually be loaded. I've added a variation of the script from xlab-si/intersight-sdk-ruby#14 which checks all classes can be loaded.

Modeled after: xlab-si/intersight-sdk-ruby#14

Note, this saves around 6 MB of memory by delay loading 214 files.

Future plugins could use useAutoload option to autoload.
This was added in 6.1.0 of the openapi-generator:
OpenAPITools/openapi-generator#13153

Note, this library has non-standard class names, even within the same plugin,
such as SDE capitalized in AutoSDEProject but not in AutosdeOpenapiClient.
To workaround this, I had to validate that all classes we try to autoload can
actually be loaded.  I've added a variation of the script from xlab-si/intersight-sdk-ruby#14
which checks all classes can be loaded.
@jrafanie
Copy link
Author

jrafanie commented May 6, 2024

cc @agrare

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.

1 participant