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

fix(perf): reduced initial start time #4818

Merged
merged 2 commits into from Apr 15, 2023

Conversation

alexander-akait
Copy link
Member

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

No need

Motivation / Use-Case

Start faster

Breaking Changes

No

Additional Info

No

@@ -355,7 +381,7 @@ class Server {
*/
static internalIPSync(family) {
try {
const { gateway } = defaultGateway[family].sync();
const { gateway } = require("default-gateway")[family].sync();
Copy link
Member Author

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

Copy link
Member Author

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"));
Copy link
Member Author

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
Copy link

codecov bot commented Apr 15, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +1.65 🎉

Comparison is base (fc2c36b) 90.45% compared to head (209a1a7) 92.10%.

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     
Impacted Files Coverage Δ
lib/Server.js 93.73% <100.00%> (+2.06%) ⬆️

... 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.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@alexander-akait alexander-akait merged commit fcf01d1 into master Apr 15, 2023
66 of 67 checks passed
@alexander-akait alexander-akait deleted the fix-perf-reduce-initial-start-time branch April 15, 2023 17:06
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

2 participants