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

swagger-ui-dist has a really slow require #28

Merged
merged 2 commits into from
Aug 6, 2018
Merged

swagger-ui-dist has a really slow require #28

merged 2 commits into from
Aug 6, 2018

Conversation

adcreare
Copy link
Contributor

@adcreare adcreare commented Aug 6, 2018

Due to some issues inside swagger-ui-dist the following require code adds around 300-500ms of latency:
const SWAGGER_UI_PATH = require('swagger-ui-dist').getAbsoluteFSPath();

Solution is to import absolute-path.js directly
A ticket exists on the swagger-ui-dist project swagger-api/swagger-ui#4502
This change makes it resolve in 0.122ms on my system so about 3 orders of magnitude better.

Additionally: updated all dependencies

Part of internal ticket: SRV-154

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 0fed908 on adcreare:master into 71dee08 on carlansley:master.

@carlansley carlansley merged commit c83b1eb into carlansley:master Aug 6, 2018
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.

None yet

3 participants