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

perf: Improve performance with large OpenAPI files [INS-3724] #7333

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

CurryYangxx
Copy link
Member

@CurryYangxx CurryYangxx commented Apr 29, 2024

Close #4653 #4241

This PR is to solve the problem of slow response to open and edit spec files
The main reason is spectral.run spend too much time and block the main process

Changes:

  • remove the spectral lint logic in the loader
  • move spectral from main process to worker thread
    • add workerpool package to admin the worker
    • modify the spectralRun IPC
  • wrap code-editor with memo to reduce rerender

@CurryYangxx CurryYangxx marked this pull request as draft April 29, 2024 09:07
@CurryYangxx CurryYangxx changed the title perf: move spectral lint to worker thread perf: Improve performance with large OpenAPI files [INS-3724] Apr 29, 2024
@CurryYangxx CurryYangxx requested a review from a team April 29, 2024 09:49
@CurryYangxx CurryYangxx marked this pull request as ready for review April 29, 2024 14:18
@jackkav
Copy link
Contributor

jackkav commented Apr 29, 2024

can you describe your reasoning for choosing workerpool over alternative approaches please, eg utilityprocess

@CurryYangxx
Copy link
Member Author

can you describe your reasoning for choosing workerpool over alternative approaches please, eg utilityprocess

I read the electron documentation about the performance best practices, it says we can use worker threads for long running CPU-heavy tasks. And I think the spectral.run is the same situation.I found workerpool is convenient to admin workers ,so I choose this package.

@jackkav
Copy link
Contributor

jackkav commented Apr 30, 2024

we have code mirror linter running in the renderer right now, perhaps we can run spectral in a similar way? worth exploring?

@jackkav jackkav marked this pull request as draft May 1, 2024 15:56
@CurryYangxx
Copy link
Member Author

We solve this issue in another appraoch in #7374. This PR is reserved for future use of the node worker treads

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.

Insomnia has become unresponsive open api specs 3
2 participants