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

Very slow startup with large number of endpoints #1813

Open
coatesap opened this issue Aug 26, 2020 · 1 comment
Open

Very slow startup with large number of endpoints #1813

coatesap opened this issue Aug 26, 2020 · 1 comment

Comments

@coatesap
Copy link

We've been experiencing very slow startup times with Dredd with our API recently. Typically it takes around 5 minutes (on a Macbook Pro) before Dredd even starts running the tests. This is for an API with around 83 paths/endpoints.

I've tracked the performance issue down to this line of code that does a deep clone of the whole API representation.

By swapping this line out for a direct assignment, the time to run dredd --names drops from around 5 minutes to 10 seconds!

Is this full clone definitely required? And if it is, are there any alternatives that could be used - ie. cloning only necessary elements of the object; modifying the options passed to clone; or using a different clone library/mechanism?

@MichalWozniakSmartlogic

Same issue here. The issue is not so much about the number of endpoints but the number of apib files. It can be reproduced by creating many copies of a single apib file. See results I got (tests are run in --dry-run mode to eliminate unnecessary noise):

Number of copied apib files, Startup time
600, 6m31.739s
500, 4m24.470s
400, 2m42.992s
300, 1m34.809s
200, 0m46.075s
100, 0m16.458s

Replacing clone method used in this line with lodash.clone or lodash.cloneDeep results in similar time improvement - from 5min to a couple of seconds.

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

No branches or pull requests

2 participants