Skip to content

Improve Performance - Refactor plp - #1049

Merged
arthurschreiber merged 3 commits into
tediousjs:masterfrom
IanChokS:refactor-plp
Feb 20, 2020
Merged

arthurschreiber merged 3 commits into
tediousjs:masterfrom
IanChokS:refactor-plp

Conversation

@IanChokS

@IanChokS IanChokS commented Feb 10, 2020 •

Copy link
Copy Markdown
Member

My Machine
Comparing #1044 (before) with this PR (after)

Before:
$ node benchmarks/query/insert-varbinary.js
query\insert-varbinary.js size=10 n=10: 719.5642319011607
query\insert-varbinary.js size=1024 n=10: 705.0743708921045
query\insert-varbinary.js size=1048576 n=10: 58.216095819036425
query\insert-varbinary.js size=10485760 n=10: 10.632852494477827
query\insert-varbinary.js size=10 n=100: 1,131.653130209141
query\insert-varbinary.js size=1024 n=100: 1,121.2849153686102
query\insert-varbinary.js size=1048576 n=100: 102.65458589586083
query\insert-varbinary.js size=10485760 n=100: 13.391209246951373

$ node benchmarks/query/select-varbinary.js
query\select-varbinary.js size=10 n=10: 960.9286414390867
query\select-varbinary.js size=100 n=10: 943.1914826790902
query\select-varbinary.js size=1000 n=10: 901.0876127485875
query\select-varbinary.js size=10000 n=10: 864.8050297060528
query\select-varbinary.js size=1048576 n=10: 97.16577066384849
query\select-varbinary.js size=10485760 n=10: 23.32439309346061
query\select-varbinary.js size=10 n=100: 1,326.780805196735
query\select-varbinary.js size=100 n=100: 1,310.4786039534335
query\select-varbinary.js size=1000 n=100: 1,290.2576349027902
query\select-varbinary.js size=10000 n=100: 1,190.9922871339486
query\select-varbinary.js size=1048576 n=100: 220.8057772047495
query\select-varbinary.js size=10485760 n=100: 30.848338247833514

$ node benchmarks/request/rpcrequest-payload.js
request\rpcrequest-payload.js size=1048576 n=10: 630.9426914753333
request\rpcrequest-payload.js size=10485760 n=10: 72.67632002000052
request\rpcrequest-payload.js size=52428800 n=10: 16.142013535171973
request\rpcrequest-payload.js size=1048576 n=100: 697.1779630412019
request\rpcrequest-payload.js size=10485760 n=100: 81.02967322839558
request\rpcrequest-payload.js size=52428800 n=100: 16.49164115396037

After:
$ node benchmarks/query/insert-varbinary.js
query\insert-varbinary.js size=10 n=10: 705.8507474359442
query\insert-varbinary.js size=1024 n=10: 699.0954194638931
query\insert-varbinary.js size=1048576 n=10: 59.53206605439921
query\insert-varbinary.js size=10485760 n=10: 10.636543974131925
query\insert-varbinary.js size=10 n=100: 1,180.315640008451
query\insert-varbinary.js size=1024 n=100: 1,097.2540121092952
query\insert-varbinary.js size=1048576 n=100: 106.0414461868382
query\insert-varbinary.js size=10485760 n=100: 14.768045833580125

$ node benchmarks/query/select-varbinary.js
query\select-varbinary.js size=10 n=10: 968.9546916786171
query\select-varbinary.js size=100 n=10: 957.42338219384
query\select-varbinary.js size=1000 n=10: 932.0185658098309
query\select-varbinary.js size=10000 n=10: 863.4386322648539
query\select-varbinary.js size=1048576 n=10: 98.86630013633662
query\select-varbinary.js size=10485760 n=10: 24.82001764206854
query\select-varbinary.js size=10 n=100: 1,348.8013876468676
query\select-varbinary.js size=100 n=100: 1,253.9326462618387
query\select-varbinary.js size=1000 n=100: 1,259.0668551909437
query\select-varbinary.js size=10000 n=100: 1,181.2916479136618
query\select-varbinary.js size=1048576 n=100: 217.26005093879152
query\select-varbinary.js size=10485760 n=100: 32.37861637170988

$ node benchmarks/request/rpcrequest-payload
request\rpcrequest-payload.js size=1048576 n=10: 2,083.5069589132427
request\rpcrequest-payload.js size=10485760 n=10: 2,155.916297843286
request\rpcrequest-payload.js size=52428800 n=10: 1,988.6250646303145
request\rpcrequest-payload.js size=1048576 n=100: 6,880.607221844057
request\rpcrequest-payload.js size=10485760 n=100: 6,671.69223003381
request\rpcrequest-payload.js size=52428800 n=100: 6,594.827017687326

Summary
rpcrequest-payload increased ops/sec by 230% for smaller bytes and up to 40,000% for larger bytes.

@codecov

codecov Bot commented Feb 10, 2020 •

Copy link
Copy Markdown

Codecov Report

Merging #1049 into master will decrease coverage by 0.39%.
The diff coverage is 96.84%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #1049     +/-   ##
=========================================
- Coverage   80.35%   79.95%   -0.4%     
=========================================
  Files          86       86             
  Lines        4397     4366     -31     
  Branches      777      785      +8     
=========================================
- Hits         3533     3491     -42     
- Misses        593      618     +25     
+ Partials      271      257     -14
Impacted Files Coverage Δ
src/data-types/null.ts 33.33% <ø> (+4.76%) ⬆️
src/data-types/floatn.ts 33.33% <ø> (+4.76%) ⬆️
src/data-types/moneyn.ts 33.33% <ø> (+4.76%) ⬆️
src/data-types/bitn.ts 33.33% <ø> (+4.76%) ⬆️
src/data-types/decimaln.ts 33.33% <ø> (+4.76%) ⬆️
src/data-types/datetimen.ts 33.33% <ø> (+4.76%) ⬆️
src/data-types/sql-variant.ts 33.33% <ø> (+4.76%) ⬆️
src/data-type.ts 100% <ø> (ø) ⬆️
src/data-types/intn.ts 33.33% <ø> (+4.76%) ⬆️
src/data-types/numericn.ts 33.33% <ø> (+4.76%) ⬆️
... and 45 more

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 86f70ba...3f7289f. Read the comment docs.

Comment thread src/data-types/varbinary.ts Resolved
@IanChokS IanChokS changed the title Refactor plp Improve Performance - Refactor plp Feb 11, 2020
Comment thread src/data-types/varbinary.ts Resolved
Comment thread src/data-types/varbinary.ts Resolved
@arthurschreiber

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 8.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants