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

[prism-cli] getHttpOperationsFromSpec performance regression #1860

Closed
nulltoken opened this issue Jul 21, 2021 · 2 comments · Fixed by #2498 · May be fixed by #2528
Closed

[prism-cli] getHttpOperationsFromSpec performance regression #1860

nulltoken opened this issue Jul 21, 2021 · 2 comments · Fixed by #2498 · May be fixed by #2528

Comments

@nulltoken
Copy link
Contributor

nulltoken commented Jul 21, 2021

Describe the bug

Following APIDevTools/json-schema-ref-parser#211 by the amazing @P0lip everything was neat and nice running Prism 4.1.2.

We recently tried to bump to 4.3.1 but discovered a similar performance regression while running getHttpOperationsFromSpec()

To Reproduce

A complete standalone repro case is available at https://github.com/nulltoken/prism_repro

Running yarn repro against

$ yarn repro
yarn run v1.22.5
$ yarn node -r ts-node/register --unhandled-rejections=strict ./src/repro.ts
Running prism v4.1.2
Converting to Prism format: 330.432ms
Number of processed (basic) endpoints 600
Done in 4.71s.
$ yarn repro
yarn run v1.22.5
$ yarn node -r ts-node/register --unhandled-rejections=strict ./src/repro.ts
Running prism v4.3.1
Converting to Prism format: 27.135s
Number of processed (basic) endpoints 600
Done in 31.13s.

Expected behavior

Jumping from 330ms to 27s when processing the same file looks a bit much, doesn't it? 😉

Getting back to 330ms would be great.
And maybe adding a unit test to protect this method from suffering from new potential performance related regressions in the future ?

/cc @chohmann

@chohmann
Copy link
Contributor

@nulltoken we probably won't be able to get to this for a few sprints as we're trying to finish up another release. However, if you need this sooner, we welcome PRs!

@nulltoken
Copy link
Contributor Author

However, if you need this sooner, we welcome PRs!

@chohmann Sadly, I'm not sure I've got the magic dust that @P0lip sprinkles around when he flaps his wings 😜

we probably won't be able to get to this for a few sprints as we're trying to finish up another release.

Fine by me, provided you keep this one on your radar. Deal?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants