-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix(perf): reduced initial start time #4818
Conversation
@@ -355,7 +381,7 @@ class Server { | |||
*/ | |||
static internalIPSync(family) { | |||
try { | |||
const { gateway } = defaultGateway[family].sync(); | |||
const { gateway } = require("default-gateway")[family].sync(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use only one method or async or sync, so it is fine to use require
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also we don't it when a developer provide IP, so avoid it for some cases
}; | ||
}; | ||
|
||
const getExpress = memoize(() => require("express")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we always run express
, but let's do it lazy
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #4818 +/- ##
==========================================
+ Coverage 90.45% 92.10% +1.65%
==========================================
Files 16 16
Lines 1665 1673 +8
Branches 624 625 +1
==========================================
+ Hits 1506 1541 +35
+ Misses 145 121 -24
+ Partials 14 11 -3
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
For Bugs and Features; did you add new tests?
No need
Motivation / Use-Case
Start faster
Breaking Changes
No
Additional Info
No