Skip to content

perf: use prepared statment cache#241

Closed
missinglink wants to merge 2 commits intomasterfrom
performance
Closed

perf: use prepared statment cache#241
missinglink wants to merge 2 commits intomasterfrom
performance

Conversation

@missinglink
Copy link
Member

This PR introduces a cache for prepared statements which improves performance by ~10% at 100VUs

Typical load test results after pre-warming on my macbook:

k6 run --vus 100 --iterations 10000 test.js

master
    iteration_duration.........: avg=55.42ms min=15.67ms med=55.18ms max=90.3ms  p(90)=63.34ms p(95)=66.49ms
    iterations.................: 10000  1797.863942/s

this PR
    iteration_duration.........: avg=44.16ms min=13.45ms med=43.4ms  max=79.23ms p(90)=47.22ms p(95)=49.71ms
    iterations.................: 10000  2253.759616/s

"lodash": "^4.17.4",
"morgan": "^1.9.0",
"node-postal": "^1.0.0",
"node-postal": "https://github.com/imothee/node-postal.git",
Copy link
Member Author

@missinglink missinglink Mar 12, 2020

Choose a reason for hiding this comment

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

hmm, I needed this for testing nodejs@v12, @orangejulius what should we do about this?
it's only tangentially related to the PR

Copy link
Member

Choose a reason for hiding this comment

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

I think it's fine to merge it. I hadn't merged it yet because I figured we'd be merging #146, but its been a while now and Node.js 12 is still not technically supported.

@missinglink missinglink force-pushed the performance branch 2 times, most recently from c63e638 to 93f2ef6 Compare March 12, 2020 10:49
@missinglink
Copy link
Member Author

superseded by #244

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.

2 participants