optimize /runOpenApi to allow pre-dereferencing OpenAPI Spec #750
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue where the
openApi
plugin would try to dereference theOpenAPI spec for each plugin when the plugin is run rather than on
initialization.
I did not attempt to fix the issue for every plugin, I simply wanted to start with
the one that was affecting me the most, the Github plugin. But this PR
adds the capability to allow any OpenAPI plugin to now use a pre-dereferenced
OpenAPI.Document
instead of de-referencing during runtime.Before:
/plugins
averaged19.472
ms before the change/runPluginQuery
averaged6867.030
ms before the changeAfter:
/plugins
averaged20.302
ms after the change/runPluginQuery
averaged1533.787
ms after the changeThat's a 77.67% decrease in runtime for the
/runPluginQuery
, but a 4.27% increase for the/plugins
query.Without the 77ms outlier the results are much nicer:
54.84% decrease in runtime for the
/plugins
query and a 77.67% decrease in runtime for the/runPluginQuery