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

perf: lazy init cookies and ip when first time use it #1216

Merged
merged 2 commits into from
Jul 11, 2018
Merged

Conversation

dead-horse
Copy link
Member

No description provided.

@dead-horse dead-horse requested a review from fengmk2 July 11, 2018 02:49
@dead-horse
Copy link
Member Author

  • bechmark test result before
  1 async middleware
  12319.35

  5 async middleware
  11579.15

  10 async middleware
  12569.11

  15 async middleware
  11661.07

  20 async middleware
  9762.09

  30 async middleware
  9716.56

  50 async middleware
  8148.58

  100 async middleware
  5868.63
  • benchmark test result after
  1 async middleware
  13943.32

  5 async middleware
  13606.49

  10 async middleware
  12345.93

  15 async middleware
  11159.54

  20 async middleware
  10569.92

  30 async middleware
  10238.07

  50 async middleware
  8820.32

  100 async middleware
  6254.53

about 5%~10% performance improvement

@codecov
Copy link

codecov bot commented Jul 11, 2018

Codecov Report

Merging #1216 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1216   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files           5       5           
  Lines         383     391    +8     
======================================
+ Hits          383     391    +8
Impacted Files Coverage Δ
lib/application.js 100% <ø> (ø) ⬆️
lib/request.js 100% <100%> (ø) ⬆️
lib/context.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 74170ca...604b501. Read the comment docs.

Copy link
Member

@fengmk2 fengmk2 left a comment

Choose a reason for hiding this comment

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

Please add tests to coverage setters.

@fengmk2 fengmk2 merged commit 162a5b3 into master Jul 11, 2018
@fengmk2 fengmk2 deleted the lazy-init branch July 11, 2018 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants