Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

optimize /runOpenApi to allow pre-dereferencing OpenAPI Spec#750

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

snowe2010
Copy link
Contributor

@snowe2010snowe2010 commentedMar 8, 2024
edited
Loading

This PR fixes an issue where theopenApi plugin would try to dereference the
OpenAPI spec for each plugin when the plugin isrun 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.472ms before the change
/runPluginQuery averaged6867.030ms before the change

GET /node-service/api/plugins 200 17.112 ms - 31024POST /node-service/api/runPluginQuery 200 6622.313 ms - 156023GET /node-service/api/plugins 200 17.698 ms - 31024POST /node-service/api/runPluginQuery 200 6632.372 ms - 156023GET /node-service/api/plugins 200 25.301 ms - 31024POST /node-service/api/runPluginQuery 200 7055.684 ms - 156023GET /node-service/api/plugins 200 17.178 ms - 31024POST /node-service/api/runPluginQuery 200 6835.205 ms - 156023GET /node-service/api/plugins 200 16.735 ms - 31024POST /node-service/api/runPluginQuery 200 7005.931 ms - 156023GET /node-service/api/plugins 200 22.808 ms - 31024POST /node-service/api/runPluginQuery 200 7050.673 ms - 156023

After:

/plugins averaged20.302ms after the change
/runPluginQuery averaged1533.787ms after the change

GET /node-service/api/plugins 200 77.839 ms - 31024POST /node-service/api/runPluginQuery 200 1824.782 ms - 156023GET /node-service/api/plugins 200 6.849 ms - 31024POST /node-service/api/runPluginQuery 200 1525.905 ms - 156023GET /node-service/api/plugins 200 15.647 ms - 31024POST /node-service/api/runPluginQuery 200 1400.096 ms - 156023GET /node-service/api/plugins 200 3.265 ms - 31024POST /node-service/api/runPluginQuery 200 1498.696 ms - 156023GET /node-service/api/plugins 200 9.287 ms - 31024POST /node-service/api/runPluginQuery 200 1625.815 ms - 156023GET /node-service/api/plugins 200 8.925 ms - 31024POST /node-service/api/runPluginQuery 200 1427.427 ms - 156023

That'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:

(6.849 ms + 15.647 ms + 3.265 ms + 9.287 ms + 8.925 ms) / 5 = ≈ 8.795 ms[(19.472 - 8.795) / 19.472] * 100 = ≈ 54.84 %

54.84% decrease in runtime for the/plugins query and a77.67% decrease in runtime for the/runPluginQuery

allow passing in an already dereferenced OpenAPI Document for pluginsthat have large openapi specs like github. This takes the runtime forGithub from over 10s to ~1s on an M1 Max.Adjust the github plugin to use this new capability by dereferencing onplugin initialization, passing the derefed document to the runOpenApifunction.
@netlifyNetlify
Copy link

netlifybot commentedMar 8, 2024

👷 Deploy request forlowcoder-cloud pending review.

Visit the deploys page to approve it

NameLink
🔨 Latest commit275cf68

@snowe2010snowe2010 changed the titleoptimize runOpenApioptimize /runOpenApi to allow pre-dereferencing OpenAPI SpecMar 8, 2024
Copy link
Contributor

@FalkWolskyFalkWolsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you very much for this truly helpful contribution!

snowe2010 reacted with heart emoji
@FalkWolskyFalkWolsky merged commitffa595a intolowcoder-org:mainMar 9, 2024
@snowe2010snowe2010 deleted the optimize-runOpenApi branchMarch 9, 2024 04:04
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@FalkWolskyFalkWolskyFalkWolsky approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@snowe2010@FalkWolsky

[8]ページ先頭

©2009-2025 Movatter.jp