bench: Add lock files and store Solana version (#2537)
This commit is contained in:
parent
9d947cb26b
commit
b5519a6532
|
@ -16,46 +16,46 @@ The programs and their tests are located in [/tests/bench](https://github.com/co
|
|||
| accountInfo1 | 1015 | - |
|
||||
| accountInfo2 | 1475 | - |
|
||||
| accountInfo4 | 1964 | - |
|
||||
| accountInfo8 | 3856 | - |
|
||||
| accountInfo8 | 3841 | - |
|
||||
| accountEmptyInit1 | 5817 | - |
|
||||
| accountEmpty1 | 1149 | - |
|
||||
| accountEmptyInit2 | 10402 | - |
|
||||
| accountEmpty2 | 1754 | - |
|
||||
| accountEmptyInit4 | 19557 | - |
|
||||
| accountEmptyInit4 | 19508 | - |
|
||||
| accountEmpty4 | 2540 | - |
|
||||
| accountEmptyInit8 | 37541 | - |
|
||||
| accountEmpty8 | 5043 | - |
|
||||
| accountEmptyInit8 | 37265 | - |
|
||||
| accountEmpty8 | 5016 | - |
|
||||
| accountSizedInit1 | 5924 | - |
|
||||
| accountSized1 | 1214 | - |
|
||||
| accountSizedInit2 | 10783 | - |
|
||||
| accountSizedInit2 | 10680 | - |
|
||||
| accountSized2 | 1873 | - |
|
||||
| accountSizedInit4 | 19975 | - |
|
||||
| accountSized4 | 2787 | - |
|
||||
| accountSizedInit8 | 38381 | - |
|
||||
| accountSized8 | 5359 | - |
|
||||
| accountSizedInit4 | 19970 | - |
|
||||
| accountSized4 | 2762 | - |
|
||||
| accountSizedInit8 | 38122 | - |
|
||||
| accountSized8 | 5353 | - |
|
||||
| accountUnsizedInit1 | 6052 | - |
|
||||
| accountUnsized1 | 1338 | - |
|
||||
| accountUnsizedInit2 | 10929 | - |
|
||||
| accountUnsized2 | 1778 | - |
|
||||
| accountUnsizedInit4 | 20495 | - |
|
||||
| accountUnsizedInit4 | 20339 | - |
|
||||
| accountUnsized4 | 3136 | - |
|
||||
| accountUnsizedInit8 | 39419 | - |
|
||||
| accountUnsizedInit8 | 39096 | - |
|
||||
| accountUnsized8 | 5952 | - |
|
||||
| boxedAccountEmptyInit1 | 6034 | - |
|
||||
| boxedAccountEmpty1 | 888 | - |
|
||||
| boxedAccountEmptyInit2 | 10633 | - |
|
||||
| boxedAccountEmpty2 | 1401 | - |
|
||||
| boxedAccountEmptyInit4 | 19500 | - |
|
||||
| boxedAccountEmptyInit4 | 19311 | - |
|
||||
| boxedAccountEmpty4 | 2424 | - |
|
||||
| boxedAccountEmptyInit8 | 37415 | - |
|
||||
| boxedAccountEmptyInit8 | 37136 | - |
|
||||
| boxedAccountEmpty8 | 4659 | - |
|
||||
| boxedAccountSizedInit1 | 6130 | - |
|
||||
| boxedAccountSized1 | 917 | - |
|
||||
| boxedAccountSizedInit2 | 10828 | - |
|
||||
| boxedAccountSized2 | 1463 | - |
|
||||
| boxedAccountSizedInit4 | 19884 | - |
|
||||
| boxedAccountSizedInit4 | 19703 | - |
|
||||
| boxedAccountSized4 | 2543 | - |
|
||||
| boxedAccountSizedInit8 | 38182 | - |
|
||||
| boxedAccountSizedInit8 | 37919 | - |
|
||||
| boxedAccountSized8 | 4898 | - |
|
||||
| boxedAccountUnsizedInit1 | 6240 | - |
|
||||
| boxedAccountUnsized1 | 972 | - |
|
||||
|
@ -63,9 +63,9 @@ The programs and their tests are located in [/tests/bench](https://github.com/co
|
|||
| boxedAccountUnsized2 | 1570 | - |
|
||||
| boxedAccountUnsizedInit4 | 20138 | - |
|
||||
| boxedAccountUnsized4 | 2768 | - |
|
||||
| boxedAccountUnsizedInit8 | 39118 | - |
|
||||
| boxedAccountUnsizedInit8 | 38791 | - |
|
||||
| boxedAccountUnsized8 | 5347 | - |
|
||||
| boxedInterfaceAccountMint1 | 2299 | - |
|
||||
| boxedInterfaceAccountMint1 | 2296 | - |
|
||||
| boxedInterfaceAccountMint2 | 4129 | - |
|
||||
| boxedInterfaceAccountMint4 | 7783 | - |
|
||||
| boxedInterfaceAccountMint8 | 15281 | - |
|
||||
|
@ -83,7 +83,7 @@ The programs and their tests are located in [/tests/bench](https://github.com/co
|
|||
| interface1 | 1059 | - |
|
||||
| interface2 | 1479 | - |
|
||||
| interface4 | 1900 | - |
|
||||
| interface8 | 3651 | - |
|
||||
| interface8 | 3646 | - |
|
||||
| program1 | 1053 | - |
|
||||
| program2 | 1467 | - |
|
||||
| program4 | 1878 | - |
|
||||
|
@ -91,15 +91,15 @@ The programs and their tests are located in [/tests/bench](https://github.com/co
|
|||
| signer1 | 1018 | - |
|
||||
| signer2 | 1484 | - |
|
||||
| signer4 | 1984 | - |
|
||||
| signer8 | 3895 | - |
|
||||
| signer8 | 3880 | - |
|
||||
| systemAccount1 | 1072 | - |
|
||||
| systemAccount2 | 1590 | - |
|
||||
| systemAccount4 | 2195 | - |
|
||||
| systemAccount8 | 4336 | - |
|
||||
| systemAccount8 | 4305 | - |
|
||||
| uncheckedAccount1 | 1014 | - |
|
||||
| uncheckedAccount2 | 1475 | - |
|
||||
| uncheckedAccount4 | 1965 | - |
|
||||
| uncheckedAccount8 | 3855 | - |
|
||||
| uncheckedAccount8 | 3841 | - |
|
||||
|
||||
### Notable changes
|
||||
|
||||
|
@ -112,46 +112,46 @@ The programs and their tests are located in [/tests/bench](https://github.com/co
|
|||
| accountInfo1 | 1015 | 🔴 **+6.39%** |
|
||||
| accountInfo2 | 1475 | 🟢 **-5.87%** |
|
||||
| accountInfo4 | 1964 | 🟢 **-4.61%** |
|
||||
| accountInfo8 | 3856 | - |
|
||||
| accountInfo8 | 3841 | - |
|
||||
| accountEmptyInit1 | 5817 | 🟢 **-2.37%** |
|
||||
| accountEmpty1 | 1149 | 🔴 **+5.41%** |
|
||||
| accountEmptyInit2 | 10402 | 🟢 **-1.63%** |
|
||||
| accountEmpty2 | 1754 | 🟢 **-5.29%** |
|
||||
| accountEmptyInit4 | 19557 | - |
|
||||
| accountEmptyInit4 | 19508 | - |
|
||||
| accountEmpty4 | 2540 | 🟢 **-4.01%** |
|
||||
| accountEmptyInit8 | 37541 | - |
|
||||
| accountEmpty8 | 5043 | - |
|
||||
| accountEmptyInit8 | 37265 | - |
|
||||
| accountEmpty8 | 5016 | - |
|
||||
| accountSizedInit1 | 5924 | 🟢 **-2.29%** |
|
||||
| accountSized1 | 1214 | 🔴 **+6.96%** |
|
||||
| accountSizedInit2 | 10783 | - |
|
||||
| accountSizedInit2 | 10680 | - |
|
||||
| accountSized2 | 1873 | 🟢 **-4.73%** |
|
||||
| accountSizedInit4 | 19975 | - |
|
||||
| accountSized4 | 2787 | - |
|
||||
| accountSizedInit8 | 38381 | - |
|
||||
| accountSized8 | 5359 | - |
|
||||
| accountSizedInit4 | 19970 | - |
|
||||
| accountSized4 | 2762 | - |
|
||||
| accountSizedInit8 | 38122 | - |
|
||||
| accountSized8 | 5353 | - |
|
||||
| accountUnsizedInit1 | 6052 | 🟢 **-2.28%** |
|
||||
| accountUnsized1 | 1338 | 🔴 **+7.64%** |
|
||||
| accountUnsizedInit2 | 10929 | 🟢 **-1.02%** |
|
||||
| accountUnsized2 | 1778 | 🟢 **-6.08%** |
|
||||
| accountUnsizedInit4 | 20495 | - |
|
||||
| accountUnsizedInit4 | 20339 | - |
|
||||
| accountUnsized4 | 3136 | 🔴 **+1.03%** |
|
||||
| accountUnsizedInit8 | 39419 | - |
|
||||
| accountUnsizedInit8 | 39096 | - |
|
||||
| accountUnsized8 | 5952 | 🟢 **-1.64%** |
|
||||
| boxedAccountEmptyInit1 | 6034 | 🟢 **-2.05%** |
|
||||
| boxedAccountEmpty1 | 888 | 🟢 **-9.02%** |
|
||||
| boxedAccountEmptyInit2 | 10633 | 🟢 **-1.40%** |
|
||||
| boxedAccountEmpty2 | 1401 | 🟢 **-6.54%** |
|
||||
| boxedAccountEmptyInit4 | 19500 | - |
|
||||
| boxedAccountEmptyInit4 | 19311 | - |
|
||||
| boxedAccountEmpty4 | 2424 | 🟢 **-4.19%** |
|
||||
| boxedAccountEmptyInit8 | 37415 | - |
|
||||
| boxedAccountEmptyInit8 | 37136 | - |
|
||||
| boxedAccountEmpty8 | 4659 | 🟢 **-2.53%** |
|
||||
| boxedAccountSizedInit1 | 6130 | 🟢 **-2.01%** |
|
||||
| boxedAccountSized1 | 917 | 🟢 **-8.57%** |
|
||||
| boxedAccountSizedInit2 | 10828 | 🟢 **-1.34%** |
|
||||
| boxedAccountSized2 | 1463 | 🟢 **-5.86%** |
|
||||
| boxedAccountSizedInit4 | 19884 | - |
|
||||
| boxedAccountSizedInit4 | 19703 | - |
|
||||
| boxedAccountSized4 | 2543 | 🟢 **-3.75%** |
|
||||
| boxedAccountSizedInit8 | 38182 | - |
|
||||
| boxedAccountSizedInit8 | 37919 | - |
|
||||
| boxedAccountSized8 | 4898 | 🟢 **-2.10%** |
|
||||
| boxedAccountUnsizedInit1 | 6240 | 🟢 **-2.10%** |
|
||||
| boxedAccountUnsized1 | 972 | 🟢 **-9.07%** |
|
||||
|
@ -159,9 +159,9 @@ The programs and their tests are located in [/tests/bench](https://github.com/co
|
|||
| boxedAccountUnsized2 | 1570 | 🟢 **-6.49%** |
|
||||
| boxedAccountUnsizedInit4 | 20138 | 🟢 **-1.05%** |
|
||||
| boxedAccountUnsized4 | 2768 | 🟢 **-4.52%** |
|
||||
| boxedAccountUnsizedInit8 | 39118 | - |
|
||||
| boxedAccountUnsizedInit8 | 38800 | - |
|
||||
| boxedAccountUnsized8 | 5347 | 🟢 **-3.08%** |
|
||||
| boxedInterfaceAccountMint1 | 2299 | - |
|
||||
| boxedInterfaceAccountMint1 | 2296 | - |
|
||||
| boxedInterfaceAccountMint2 | 4129 | 🔴 **+1.88%** |
|
||||
| boxedInterfaceAccountMint4 | 7783 | 🔴 **+3.25%** |
|
||||
| boxedInterfaceAccountMint8 | 15281 | 🔴 **+3.96%** |
|
||||
|
@ -179,7 +179,7 @@ The programs and their tests are located in [/tests/bench](https://github.com/co
|
|||
| interface1 | 1059 | 🔴 **+6.01%** |
|
||||
| interface2 | 1479 | 🟢 **-6.04%** |
|
||||
| interface4 | 1900 | 🟢 **-4.81%** |
|
||||
| interface8 | 3651 | - |
|
||||
| interface8 | 3646 | - |
|
||||
| program1 | 1053 | 🔴 **+5.41%** |
|
||||
| program2 | 1467 | 🟢 **-6.74%** |
|
||||
| program4 | 1878 | 🟢 **-6.01%** |
|
||||
|
@ -187,15 +187,15 @@ The programs and their tests are located in [/tests/bench](https://github.com/co
|
|||
| signer1 | 1018 | 🔴 **+6.26%** |
|
||||
| signer2 | 1484 | 🟢 **-5.84%** |
|
||||
| signer4 | 1984 | 🟢 **-4.57%** |
|
||||
| signer8 | 3895 | - |
|
||||
| signer8 | 3880 | - |
|
||||
| systemAccount1 | 1072 | 🔴 **+5.82%** |
|
||||
| systemAccount2 | 1590 | 🟢 **-5.69%** |
|
||||
| systemAccount4 | 2195 | 🟢 **-4.48%** |
|
||||
| systemAccount8 | 4336 | - |
|
||||
| systemAccount8 | 4305 | - |
|
||||
| uncheckedAccount1 | 1014 | 🔴 **+6.40%** |
|
||||
| uncheckedAccount2 | 1475 | 🟢 **-5.87%** |
|
||||
| uncheckedAccount4 | 1965 | 🟢 **-4.61%** |
|
||||
| uncheckedAccount8 | 3855 | - |
|
||||
| uncheckedAccount8 | 3841 | - |
|
||||
|
||||
### Notable changes
|
||||
|
||||
|
|
|
@ -1,275 +1,284 @@
|
|||
{
|
||||
"0.27.0": {
|
||||
"computeUnits": {
|
||||
"accountInfo1": 954,
|
||||
"accountInfo2": 1567,
|
||||
"accountInfo4": 2059,
|
||||
"accountInfo8": 3856,
|
||||
"accountEmptyInit1": 5958,
|
||||
"accountEmpty1": 1090,
|
||||
"accountEmptyInit2": 10574,
|
||||
"accountEmpty2": 1852,
|
||||
"accountEmptyInit4": 19557,
|
||||
"accountEmpty4": 2646,
|
||||
"accountEmptyInit8": 37541,
|
||||
"accountEmpty8": 5043,
|
||||
"accountSizedInit1": 6063,
|
||||
"accountSized1": 1135,
|
||||
"accountSizedInit2": 10783,
|
||||
"accountSized2": 1966,
|
||||
"accountSizedInit4": 19975,
|
||||
"accountSized4": 2787,
|
||||
"accountSizedInit8": 38381,
|
||||
"accountSized8": 5359,
|
||||
"accountUnsizedInit1": 6193,
|
||||
"accountUnsized1": 1243,
|
||||
"accountUnsizedInit2": 11042,
|
||||
"accountUnsized2": 1893,
|
||||
"accountUnsizedInit4": 20495,
|
||||
"accountUnsized4": 3104,
|
||||
"accountUnsizedInit8": 39419,
|
||||
"accountUnsized8": 6051,
|
||||
"boxedAccountEmptyInit1": 6160,
|
||||
"boxedAccountEmpty1": 976,
|
||||
"boxedAccountEmptyInit2": 10784,
|
||||
"boxedAccountEmpty2": 1499,
|
||||
"boxedAccountEmptyInit4": 19500,
|
||||
"boxedAccountEmpty4": 2530,
|
||||
"boxedAccountEmptyInit8": 37415,
|
||||
"boxedAccountEmpty8": 4780,
|
||||
"boxedAccountSizedInit1": 6256,
|
||||
"boxedAccountSized1": 1003,
|
||||
"boxedAccountSizedInit2": 10975,
|
||||
"boxedAccountSized2": 1554,
|
||||
"boxedAccountSizedInit4": 19884,
|
||||
"boxedAccountSized4": 2642,
|
||||
"boxedAccountSizedInit8": 38182,
|
||||
"boxedAccountSized8": 5003,
|
||||
"boxedAccountUnsizedInit1": 6374,
|
||||
"boxedAccountUnsized1": 1069,
|
||||
"boxedAccountUnsizedInit2": 11211,
|
||||
"boxedAccountUnsized2": 1679,
|
||||
"boxedAccountUnsizedInit4": 20351,
|
||||
"boxedAccountUnsized4": 2899,
|
||||
"boxedAccountUnsizedInit8": 39118,
|
||||
"boxedAccountUnsized8": 5517,
|
||||
"boxedInterfaceAccountMint1": 2299,
|
||||
"boxedInterfaceAccountMint2": 4053,
|
||||
"boxedInterfaceAccountMint4": 7538,
|
||||
"boxedInterfaceAccountMint8": 14699,
|
||||
"boxedInterfaceAccountToken1": 1737,
|
||||
"boxedInterfaceAccountToken2": 2928,
|
||||
"boxedInterfaceAccountToken4": 5291,
|
||||
"boxedInterfaceAccountToken8": 10205,
|
||||
"interfaceAccountMint1": 2530,
|
||||
"interfaceAccountMint2": 4726,
|
||||
"interfaceAccountMint4": 9431,
|
||||
"interfaceAccountMint8": 17709,
|
||||
"interfaceAccountToken1": 1755,
|
||||
"interfaceAccountToken2": 3211,
|
||||
"interfaceAccountToken4": 6006,
|
||||
"interface1": 999,
|
||||
"interface2": 1574,
|
||||
"interface4": 1996,
|
||||
"interface8": 3651,
|
||||
"program1": 999,
|
||||
"program2": 1573,
|
||||
"program4": 1998,
|
||||
"program8": 3651,
|
||||
"signer1": 958,
|
||||
"signer2": 1576,
|
||||
"signer4": 2079,
|
||||
"signer8": 3895,
|
||||
"systemAccount1": 1013,
|
||||
"systemAccount2": 1686,
|
||||
"systemAccount4": 2298,
|
||||
"systemAccount8": 4336,
|
||||
"uncheckedAccount1": 953,
|
||||
"uncheckedAccount2": 1567,
|
||||
"uncheckedAccount4": 2060,
|
||||
"uncheckedAccount8": 3855
|
||||
"solanaVersion": "1.14.16",
|
||||
"result": {
|
||||
"computeUnits": {
|
||||
"accountInfo1": 954,
|
||||
"accountInfo2": 1567,
|
||||
"accountInfo4": 2059,
|
||||
"accountInfo8": 3856,
|
||||
"accountEmptyInit1": 5958,
|
||||
"accountEmpty1": 1090,
|
||||
"accountEmptyInit2": 10574,
|
||||
"accountEmpty2": 1852,
|
||||
"accountEmptyInit4": 19557,
|
||||
"accountEmpty4": 2646,
|
||||
"accountEmptyInit8": 37541,
|
||||
"accountEmpty8": 5043,
|
||||
"accountSizedInit1": 6063,
|
||||
"accountSized1": 1135,
|
||||
"accountSizedInit2": 10783,
|
||||
"accountSized2": 1966,
|
||||
"accountSizedInit4": 19975,
|
||||
"accountSized4": 2787,
|
||||
"accountSizedInit8": 38381,
|
||||
"accountSized8": 5359,
|
||||
"accountUnsizedInit1": 6193,
|
||||
"accountUnsized1": 1243,
|
||||
"accountUnsizedInit2": 11042,
|
||||
"accountUnsized2": 1893,
|
||||
"accountUnsizedInit4": 20495,
|
||||
"accountUnsized4": 3104,
|
||||
"accountUnsizedInit8": 39419,
|
||||
"accountUnsized8": 6051,
|
||||
"boxedAccountEmptyInit1": 6160,
|
||||
"boxedAccountEmpty1": 976,
|
||||
"boxedAccountEmptyInit2": 10784,
|
||||
"boxedAccountEmpty2": 1499,
|
||||
"boxedAccountEmptyInit4": 19500,
|
||||
"boxedAccountEmpty4": 2530,
|
||||
"boxedAccountEmptyInit8": 37415,
|
||||
"boxedAccountEmpty8": 4780,
|
||||
"boxedAccountSizedInit1": 6256,
|
||||
"boxedAccountSized1": 1003,
|
||||
"boxedAccountSizedInit2": 10975,
|
||||
"boxedAccountSized2": 1554,
|
||||
"boxedAccountSizedInit4": 19884,
|
||||
"boxedAccountSized4": 2642,
|
||||
"boxedAccountSizedInit8": 38182,
|
||||
"boxedAccountSized8": 5003,
|
||||
"boxedAccountUnsizedInit1": 6374,
|
||||
"boxedAccountUnsized1": 1069,
|
||||
"boxedAccountUnsizedInit2": 11211,
|
||||
"boxedAccountUnsized2": 1679,
|
||||
"boxedAccountUnsizedInit4": 20351,
|
||||
"boxedAccountUnsized4": 2899,
|
||||
"boxedAccountUnsizedInit8": 39118,
|
||||
"boxedAccountUnsized8": 5517,
|
||||
"boxedInterfaceAccountMint1": 2299,
|
||||
"boxedInterfaceAccountMint2": 4053,
|
||||
"boxedInterfaceAccountMint4": 7538,
|
||||
"boxedInterfaceAccountMint8": 14699,
|
||||
"boxedInterfaceAccountToken1": 1737,
|
||||
"boxedInterfaceAccountToken2": 2928,
|
||||
"boxedInterfaceAccountToken4": 5291,
|
||||
"boxedInterfaceAccountToken8": 10205,
|
||||
"interfaceAccountMint1": 2530,
|
||||
"interfaceAccountMint2": 4726,
|
||||
"interfaceAccountMint4": 9431,
|
||||
"interfaceAccountMint8": 17709,
|
||||
"interfaceAccountToken1": 1755,
|
||||
"interfaceAccountToken2": 3211,
|
||||
"interfaceAccountToken4": 6006,
|
||||
"interface1": 999,
|
||||
"interface2": 1574,
|
||||
"interface4": 1996,
|
||||
"interface8": 3651,
|
||||
"program1": 999,
|
||||
"program2": 1573,
|
||||
"program4": 1998,
|
||||
"program8": 3651,
|
||||
"signer1": 958,
|
||||
"signer2": 1576,
|
||||
"signer4": 2079,
|
||||
"signer8": 3895,
|
||||
"systemAccount1": 1013,
|
||||
"systemAccount2": 1686,
|
||||
"systemAccount4": 2298,
|
||||
"systemAccount8": 4336,
|
||||
"uncheckedAccount1": 953,
|
||||
"uncheckedAccount2": 1567,
|
||||
"uncheckedAccount4": 2060,
|
||||
"uncheckedAccount8": 3855
|
||||
}
|
||||
}
|
||||
},
|
||||
"0.28.0": {
|
||||
"computeUnits": {
|
||||
"accountInfo1": 1015,
|
||||
"accountInfo2": 1475,
|
||||
"accountInfo4": 1964,
|
||||
"accountInfo8": 3856,
|
||||
"accountEmptyInit1": 5817,
|
||||
"accountEmpty1": 1149,
|
||||
"accountEmptyInit2": 10402,
|
||||
"accountEmpty2": 1754,
|
||||
"accountEmptyInit4": 19557,
|
||||
"accountEmpty4": 2540,
|
||||
"accountEmptyInit8": 37541,
|
||||
"accountEmpty8": 5043,
|
||||
"accountSizedInit1": 5924,
|
||||
"accountSized1": 1214,
|
||||
"accountSizedInit2": 10783,
|
||||
"accountSized2": 1873,
|
||||
"accountSizedInit4": 19975,
|
||||
"accountSized4": 2787,
|
||||
"accountSizedInit8": 38381,
|
||||
"accountSized8": 5359,
|
||||
"accountUnsizedInit1": 6052,
|
||||
"accountUnsized1": 1338,
|
||||
"accountUnsizedInit2": 10929,
|
||||
"accountUnsized2": 1778,
|
||||
"accountUnsizedInit4": 20495,
|
||||
"accountUnsized4": 3136,
|
||||
"accountUnsizedInit8": 39419,
|
||||
"accountUnsized8": 5952,
|
||||
"boxedAccountEmptyInit1": 6034,
|
||||
"boxedAccountEmpty1": 888,
|
||||
"boxedAccountEmptyInit2": 10633,
|
||||
"boxedAccountEmpty2": 1401,
|
||||
"boxedAccountEmptyInit4": 19500,
|
||||
"boxedAccountEmpty4": 2424,
|
||||
"boxedAccountEmptyInit8": 37415,
|
||||
"boxedAccountEmpty8": 4659,
|
||||
"boxedAccountSizedInit1": 6130,
|
||||
"boxedAccountSized1": 917,
|
||||
"boxedAccountSizedInit2": 10828,
|
||||
"boxedAccountSized2": 1463,
|
||||
"boxedAccountSizedInit4": 19884,
|
||||
"boxedAccountSized4": 2543,
|
||||
"boxedAccountSizedInit8": 38182,
|
||||
"boxedAccountSized8": 4898,
|
||||
"boxedAccountUnsizedInit1": 6240,
|
||||
"boxedAccountUnsized1": 972,
|
||||
"boxedAccountUnsizedInit2": 11048,
|
||||
"boxedAccountUnsized2": 1570,
|
||||
"boxedAccountUnsizedInit4": 20138,
|
||||
"boxedAccountUnsized4": 2768,
|
||||
"boxedAccountUnsizedInit8": 39118,
|
||||
"boxedAccountUnsized8": 5347,
|
||||
"boxedInterfaceAccountMint1": 2299,
|
||||
"boxedInterfaceAccountMint2": 4129,
|
||||
"boxedInterfaceAccountMint4": 7783,
|
||||
"boxedInterfaceAccountMint8": 15281,
|
||||
"boxedInterfaceAccountToken1": 2023,
|
||||
"boxedInterfaceAccountToken2": 3582,
|
||||
"boxedInterfaceAccountToken4": 6692,
|
||||
"boxedInterfaceAccountToken8": 13098,
|
||||
"interfaceAccountMint1": 2364,
|
||||
"interfaceAccountMint2": 5030,
|
||||
"interfaceAccountMint4": 9803,
|
||||
"interfaceAccountMint8": 18400,
|
||||
"interfaceAccountToken1": 2091,
|
||||
"interfaceAccountToken2": 3948,
|
||||
"interfaceAccountToken4": 7547,
|
||||
"interface1": 1059,
|
||||
"interface2": 1479,
|
||||
"interface4": 1900,
|
||||
"interface8": 3651,
|
||||
"program1": 1053,
|
||||
"program2": 1467,
|
||||
"program4": 1878,
|
||||
"program8": 3598,
|
||||
"signer1": 1018,
|
||||
"signer2": 1484,
|
||||
"signer4": 1984,
|
||||
"signer8": 3895,
|
||||
"systemAccount1": 1072,
|
||||
"systemAccount2": 1590,
|
||||
"systemAccount4": 2195,
|
||||
"systemAccount8": 4336,
|
||||
"uncheckedAccount1": 1014,
|
||||
"uncheckedAccount2": 1475,
|
||||
"uncheckedAccount4": 1965,
|
||||
"uncheckedAccount8": 3855
|
||||
"solanaVersion": "1.16.0",
|
||||
"result": {
|
||||
"computeUnits": {
|
||||
"accountInfo1": 1015,
|
||||
"accountInfo2": 1475,
|
||||
"accountInfo4": 1964,
|
||||
"accountInfo8": 3841,
|
||||
"accountEmptyInit1": 5817,
|
||||
"accountEmpty1": 1149,
|
||||
"accountEmptyInit2": 10402,
|
||||
"accountEmpty2": 1754,
|
||||
"accountEmptyInit4": 19508,
|
||||
"accountEmpty4": 2540,
|
||||
"accountEmptyInit8": 37265,
|
||||
"accountEmpty8": 5016,
|
||||
"accountSizedInit1": 5924,
|
||||
"accountSized1": 1214,
|
||||
"accountSizedInit2": 10680,
|
||||
"accountSized2": 1873,
|
||||
"accountSizedInit4": 19970,
|
||||
"accountSized4": 2762,
|
||||
"accountSizedInit8": 38122,
|
||||
"accountSized8": 5353,
|
||||
"accountUnsizedInit1": 6052,
|
||||
"accountUnsized1": 1338,
|
||||
"accountUnsizedInit2": 10929,
|
||||
"accountUnsized2": 1778,
|
||||
"accountUnsizedInit4": 20339,
|
||||
"accountUnsized4": 3136,
|
||||
"accountUnsizedInit8": 39096,
|
||||
"accountUnsized8": 5952,
|
||||
"boxedAccountEmptyInit1": 6034,
|
||||
"boxedAccountEmpty1": 888,
|
||||
"boxedAccountEmptyInit2": 10633,
|
||||
"boxedAccountEmpty2": 1401,
|
||||
"boxedAccountEmptyInit4": 19311,
|
||||
"boxedAccountEmpty4": 2424,
|
||||
"boxedAccountEmptyInit8": 37136,
|
||||
"boxedAccountEmpty8": 4659,
|
||||
"boxedAccountSizedInit1": 6130,
|
||||
"boxedAccountSized1": 917,
|
||||
"boxedAccountSizedInit2": 10828,
|
||||
"boxedAccountSized2": 1463,
|
||||
"boxedAccountSizedInit4": 19703,
|
||||
"boxedAccountSized4": 2543,
|
||||
"boxedAccountSizedInit8": 37919,
|
||||
"boxedAccountSized8": 4898,
|
||||
"boxedAccountUnsizedInit1": 6240,
|
||||
"boxedAccountUnsized1": 972,
|
||||
"boxedAccountUnsizedInit2": 11048,
|
||||
"boxedAccountUnsized2": 1570,
|
||||
"boxedAccountUnsizedInit4": 20138,
|
||||
"boxedAccountUnsized4": 2768,
|
||||
"boxedAccountUnsizedInit8": 38800,
|
||||
"boxedAccountUnsized8": 5347,
|
||||
"boxedInterfaceAccountMint1": 2296,
|
||||
"boxedInterfaceAccountMint2": 4129,
|
||||
"boxedInterfaceAccountMint4": 7783,
|
||||
"boxedInterfaceAccountMint8": 15281,
|
||||
"boxedInterfaceAccountToken1": 2023,
|
||||
"boxedInterfaceAccountToken2": 3582,
|
||||
"boxedInterfaceAccountToken4": 6692,
|
||||
"boxedInterfaceAccountToken8": 13098,
|
||||
"interfaceAccountMint1": 2364,
|
||||
"interfaceAccountMint2": 5030,
|
||||
"interfaceAccountMint4": 9803,
|
||||
"interfaceAccountMint8": 18400,
|
||||
"interfaceAccountToken1": 2091,
|
||||
"interfaceAccountToken2": 3948,
|
||||
"interfaceAccountToken4": 7547,
|
||||
"interface1": 1059,
|
||||
"interface2": 1479,
|
||||
"interface4": 1900,
|
||||
"interface8": 3646,
|
||||
"program1": 1053,
|
||||
"program2": 1467,
|
||||
"program4": 1878,
|
||||
"program8": 3598,
|
||||
"signer1": 1018,
|
||||
"signer2": 1484,
|
||||
"signer4": 1984,
|
||||
"signer8": 3880,
|
||||
"systemAccount1": 1072,
|
||||
"systemAccount2": 1590,
|
||||
"systemAccount4": 2195,
|
||||
"systemAccount8": 4305,
|
||||
"uncheckedAccount1": 1014,
|
||||
"uncheckedAccount2": 1475,
|
||||
"uncheckedAccount4": 1965,
|
||||
"uncheckedAccount8": 3841
|
||||
}
|
||||
}
|
||||
},
|
||||
"unreleased": {
|
||||
"computeUnits": {
|
||||
"accountInfo1": 1015,
|
||||
"accountInfo2": 1475,
|
||||
"accountInfo4": 1964,
|
||||
"accountInfo8": 3856,
|
||||
"accountEmptyInit1": 5817,
|
||||
"accountEmpty1": 1149,
|
||||
"accountEmptyInit2": 10402,
|
||||
"accountEmpty2": 1754,
|
||||
"accountEmptyInit4": 19557,
|
||||
"accountEmpty4": 2540,
|
||||
"accountEmptyInit8": 37541,
|
||||
"accountEmpty8": 5043,
|
||||
"accountSizedInit1": 5924,
|
||||
"accountSized1": 1214,
|
||||
"accountSizedInit2": 10783,
|
||||
"accountSized2": 1873,
|
||||
"accountSizedInit4": 19975,
|
||||
"accountSized4": 2787,
|
||||
"accountSizedInit8": 38381,
|
||||
"accountSized8": 5359,
|
||||
"accountUnsizedInit1": 6052,
|
||||
"accountUnsized1": 1338,
|
||||
"accountUnsizedInit2": 10929,
|
||||
"accountUnsized2": 1778,
|
||||
"accountUnsizedInit4": 20495,
|
||||
"accountUnsized4": 3136,
|
||||
"accountUnsizedInit8": 39419,
|
||||
"accountUnsized8": 5952,
|
||||
"boxedAccountEmptyInit1": 6034,
|
||||
"boxedAccountEmpty1": 888,
|
||||
"boxedAccountEmptyInit2": 10633,
|
||||
"boxedAccountEmpty2": 1401,
|
||||
"boxedAccountEmptyInit4": 19500,
|
||||
"boxedAccountEmpty4": 2424,
|
||||
"boxedAccountEmptyInit8": 37415,
|
||||
"boxedAccountEmpty8": 4659,
|
||||
"boxedAccountSizedInit1": 6130,
|
||||
"boxedAccountSized1": 917,
|
||||
"boxedAccountSizedInit2": 10828,
|
||||
"boxedAccountSized2": 1463,
|
||||
"boxedAccountSizedInit4": 19884,
|
||||
"boxedAccountSized4": 2543,
|
||||
"boxedAccountSizedInit8": 38182,
|
||||
"boxedAccountSized8": 4898,
|
||||
"boxedAccountUnsizedInit1": 6240,
|
||||
"boxedAccountUnsized1": 972,
|
||||
"boxedAccountUnsizedInit2": 11048,
|
||||
"boxedAccountUnsized2": 1570,
|
||||
"boxedAccountUnsizedInit4": 20138,
|
||||
"boxedAccountUnsized4": 2768,
|
||||
"boxedAccountUnsizedInit8": 39118,
|
||||
"boxedAccountUnsized8": 5347,
|
||||
"boxedInterfaceAccountMint1": 2299,
|
||||
"boxedInterfaceAccountMint2": 4129,
|
||||
"boxedInterfaceAccountMint4": 7783,
|
||||
"boxedInterfaceAccountMint8": 15281,
|
||||
"boxedInterfaceAccountToken1": 2023,
|
||||
"boxedInterfaceAccountToken2": 3582,
|
||||
"boxedInterfaceAccountToken4": 6692,
|
||||
"boxedInterfaceAccountToken8": 13098,
|
||||
"interfaceAccountMint1": 2364,
|
||||
"interfaceAccountMint2": 5030,
|
||||
"interfaceAccountMint4": 9803,
|
||||
"interfaceAccountMint8": 18400,
|
||||
"interfaceAccountToken1": 2091,
|
||||
"interfaceAccountToken2": 3948,
|
||||
"interfaceAccountToken4": 7547,
|
||||
"interface1": 1059,
|
||||
"interface2": 1479,
|
||||
"interface4": 1900,
|
||||
"interface8": 3651,
|
||||
"program1": 1053,
|
||||
"program2": 1467,
|
||||
"program4": 1878,
|
||||
"program8": 3598,
|
||||
"signer1": 1018,
|
||||
"signer2": 1484,
|
||||
"signer4": 1984,
|
||||
"signer8": 3895,
|
||||
"systemAccount1": 1072,
|
||||
"systemAccount2": 1590,
|
||||
"systemAccount4": 2195,
|
||||
"systemAccount8": 4336,
|
||||
"uncheckedAccount1": 1014,
|
||||
"uncheckedAccount2": 1475,
|
||||
"uncheckedAccount4": 1965,
|
||||
"uncheckedAccount8": 3855
|
||||
"solanaVersion": "1.16.0",
|
||||
"result": {
|
||||
"computeUnits": {
|
||||
"accountInfo1": 1015,
|
||||
"accountInfo2": 1475,
|
||||
"accountInfo4": 1964,
|
||||
"accountInfo8": 3841,
|
||||
"accountEmptyInit1": 5817,
|
||||
"accountEmpty1": 1149,
|
||||
"accountEmptyInit2": 10402,
|
||||
"accountEmpty2": 1754,
|
||||
"accountEmptyInit4": 19508,
|
||||
"accountEmpty4": 2540,
|
||||
"accountEmptyInit8": 37265,
|
||||
"accountEmpty8": 5016,
|
||||
"accountSizedInit1": 5924,
|
||||
"accountSized1": 1214,
|
||||
"accountSizedInit2": 10680,
|
||||
"accountSized2": 1873,
|
||||
"accountSizedInit4": 19970,
|
||||
"accountSized4": 2762,
|
||||
"accountSizedInit8": 38122,
|
||||
"accountSized8": 5353,
|
||||
"accountUnsizedInit1": 6052,
|
||||
"accountUnsized1": 1338,
|
||||
"accountUnsizedInit2": 10929,
|
||||
"accountUnsized2": 1778,
|
||||
"accountUnsizedInit4": 20339,
|
||||
"accountUnsized4": 3136,
|
||||
"accountUnsizedInit8": 39096,
|
||||
"accountUnsized8": 5952,
|
||||
"boxedAccountEmptyInit1": 6034,
|
||||
"boxedAccountEmpty1": 888,
|
||||
"boxedAccountEmptyInit2": 10633,
|
||||
"boxedAccountEmpty2": 1401,
|
||||
"boxedAccountEmptyInit4": 19311,
|
||||
"boxedAccountEmpty4": 2424,
|
||||
"boxedAccountEmptyInit8": 37136,
|
||||
"boxedAccountEmpty8": 4659,
|
||||
"boxedAccountSizedInit1": 6130,
|
||||
"boxedAccountSized1": 917,
|
||||
"boxedAccountSizedInit2": 10828,
|
||||
"boxedAccountSized2": 1463,
|
||||
"boxedAccountSizedInit4": 19703,
|
||||
"boxedAccountSized4": 2543,
|
||||
"boxedAccountSizedInit8": 37919,
|
||||
"boxedAccountSized8": 4898,
|
||||
"boxedAccountUnsizedInit1": 6240,
|
||||
"boxedAccountUnsized1": 972,
|
||||
"boxedAccountUnsizedInit2": 11048,
|
||||
"boxedAccountUnsized2": 1570,
|
||||
"boxedAccountUnsizedInit4": 20138,
|
||||
"boxedAccountUnsized4": 2768,
|
||||
"boxedAccountUnsizedInit8": 38791,
|
||||
"boxedAccountUnsized8": 5347,
|
||||
"boxedInterfaceAccountMint1": 2296,
|
||||
"boxedInterfaceAccountMint2": 4129,
|
||||
"boxedInterfaceAccountMint4": 7783,
|
||||
"boxedInterfaceAccountMint8": 15281,
|
||||
"boxedInterfaceAccountToken1": 2023,
|
||||
"boxedInterfaceAccountToken2": 3582,
|
||||
"boxedInterfaceAccountToken4": 6692,
|
||||
"boxedInterfaceAccountToken8": 13098,
|
||||
"interfaceAccountMint1": 2364,
|
||||
"interfaceAccountMint2": 5030,
|
||||
"interfaceAccountMint4": 9803,
|
||||
"interfaceAccountMint8": 18400,
|
||||
"interfaceAccountToken1": 2091,
|
||||
"interfaceAccountToken2": 3948,
|
||||
"interfaceAccountToken4": 7547,
|
||||
"interface1": 1059,
|
||||
"interface2": 1479,
|
||||
"interface4": 1900,
|
||||
"interface8": 3646,
|
||||
"program1": 1053,
|
||||
"program2": 1467,
|
||||
"program4": 1878,
|
||||
"program8": 3598,
|
||||
"signer1": 1018,
|
||||
"signer2": 1484,
|
||||
"signer4": 1984,
|
||||
"signer8": 3880,
|
||||
"systemAccount1": 1072,
|
||||
"systemAccount2": 1590,
|
||||
"systemAccount4": 2195,
|
||||
"systemAccount8": 4305,
|
||||
"uncheckedAccount1": 1014,
|
||||
"uncheckedAccount2": 1475,
|
||||
"uncheckedAccount4": 1965,
|
||||
"uncheckedAccount8": 3841
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -14,6 +14,6 @@
|
|||
"node": ">=17"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "anchor test"
|
||||
"test": "anchor test --skip-lint"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,16 +3,27 @@
|
|||
* version to a new version and adding a new `Unreleased` version.
|
||||
*/
|
||||
|
||||
import { BenchData } from "./utils";
|
||||
import {
|
||||
ANCHOR_VERSION_ARG,
|
||||
BenchData,
|
||||
LockFile,
|
||||
getVersionFromArgs,
|
||||
} from "./utils";
|
||||
|
||||
(async () => {
|
||||
const newVersion = process.argv[2];
|
||||
const newVersion = getVersionFromArgs();
|
||||
|
||||
if (!newVersion) {
|
||||
console.error("Usage: anchor run bump-version -- <VERSION>");
|
||||
process.exit(1);
|
||||
if (newVersion === "unreleased") {
|
||||
console.error(
|
||||
`Usage: anchor run bump-version ${ANCHOR_VERSION_ARG} <VERSION>`
|
||||
);
|
||||
process.exitCode = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
// Cache lock file in ./locks
|
||||
await LockFile.cache(newVersion);
|
||||
|
||||
// Bump bench data
|
||||
const bench = await BenchData.open();
|
||||
bench.bumpVersion(newVersion);
|
||||
|
|
|
@ -20,8 +20,10 @@ import { BenchData, Markdown } from "./utils";
|
|||
return;
|
||||
}
|
||||
|
||||
const newComputeUnitsResult = bench.get(nextVersion).computeUnits;
|
||||
const oldComputeUnitsResult = bench.get(currentVersion).computeUnits;
|
||||
const newComputeUnitsResult =
|
||||
bench.get(nextVersion).result.computeUnits;
|
||||
const oldComputeUnitsResult =
|
||||
bench.get(currentVersion).result.computeUnits;
|
||||
|
||||
// Create table
|
||||
const table = Markdown.createTable(
|
||||
|
|
|
@ -6,9 +6,15 @@
|
|||
*/
|
||||
|
||||
import path from "path";
|
||||
import { spawnSync } from "child_process";
|
||||
|
||||
import { ANCHOR_VERSION_ARG, BenchData, Toml } from "./utils";
|
||||
import {
|
||||
ANCHOR_VERSION_ARG,
|
||||
BenchData,
|
||||
LockFile,
|
||||
Toml,
|
||||
VersionManager,
|
||||
runAnchorTest,
|
||||
} from "./utils";
|
||||
|
||||
(async () => {
|
||||
const bench = await BenchData.open();
|
||||
|
@ -23,6 +29,12 @@ import { ANCHOR_VERSION_ARG, BenchData, Toml } from "./utils";
|
|||
|
||||
const isUnreleased = version === "unreleased";
|
||||
|
||||
// Use the lock file from cache
|
||||
await LockFile.replace(version);
|
||||
|
||||
// Set active solana version
|
||||
VersionManager.setSolanaVersion(bench.get(version).solanaVersion);
|
||||
|
||||
// Update the anchor dependency versions
|
||||
for (const dependency of ["lang", "spl"]) {
|
||||
cargoToml.replaceValue(`anchor-${dependency}`, () => {
|
||||
|
@ -53,10 +65,10 @@ import { ANCHOR_VERSION_ARG, BenchData, Toml } from "./utils";
|
|||
await anchorToml.save();
|
||||
|
||||
// Run the command to update the current version's results
|
||||
const result = spawnSync("anchor", ["test", "--skip-lint"]);
|
||||
const result = runAnchorTest();
|
||||
console.log(result.output.toString());
|
||||
|
||||
// Check for failure
|
||||
// Check failure
|
||||
if (result.status !== 0) {
|
||||
console.error("Please fix the error and re-run this command.");
|
||||
process.exitCode = 1;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as fs from "fs/promises";
|
||||
import path from "path";
|
||||
import { spawnSync } from "child_process";
|
||||
import { execSync, spawnSync } from "child_process";
|
||||
|
||||
/** Version that is used in bench data file */
|
||||
export type Version = "unreleased" | (`${number}.${number}.${number}` & {});
|
||||
|
@ -8,8 +8,17 @@ export type Version = "unreleased" | (`${number}.${number}.${number}` & {});
|
|||
/** Persistent benchmark data(mapping of `Version -> Data`) */
|
||||
type Bench = {
|
||||
[key: string]: {
|
||||
/** Benchmark result for compute units consumed */
|
||||
computeUnits: ComputeUnits;
|
||||
/**
|
||||
* Storing Solana version used in the release to:
|
||||
* - Be able to build older versions
|
||||
* - Adjust for the changes in platform-tools
|
||||
*/
|
||||
solanaVersion: Version;
|
||||
/** Benchmark results for a version */
|
||||
result: {
|
||||
/** Benchmark result for compute units consumed */
|
||||
computeUnits: ComputeUnits;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -173,8 +182,7 @@ export class BenchData {
|
|||
/** Bump benchmark data version to the given version */
|
||||
bumpVersion(newVersion: string) {
|
||||
if (this.#data[newVersion]) {
|
||||
console.error(`Version '${newVersion}' already exists!`);
|
||||
process.exit(1);
|
||||
throw new Error(`Version '${newVersion}' already exists!`);
|
||||
}
|
||||
|
||||
const versions = this.getVersions();
|
||||
|
@ -186,7 +194,7 @@ export class BenchData {
|
|||
// Delete the unreleased version
|
||||
delete this.#data[unreleasedVersion];
|
||||
|
||||
// Add new unreleased version
|
||||
// Add the new unreleased version
|
||||
this.#data[unreleasedVersion] = this.#data[newVersion];
|
||||
}
|
||||
|
||||
|
@ -207,7 +215,7 @@ export class BenchData {
|
|||
}
|
||||
|
||||
// Format
|
||||
spawnSync("yarn", [
|
||||
spawn("yarn", [
|
||||
"run",
|
||||
"prettier",
|
||||
"--write",
|
||||
|
@ -268,8 +276,7 @@ export class Markdown {
|
|||
bumpVersion(newVersion: string) {
|
||||
newVersion = `[${newVersion}]`;
|
||||
if (this.#text.includes(newVersion)) {
|
||||
console.error(`Version '${newVersion}' already exists!`);
|
||||
process.exit(1);
|
||||
throw new Error(`Version '${newVersion}' already exists!`);
|
||||
}
|
||||
|
||||
const startIndex = this.#text.indexOf(`## ${Markdown.#UNRELEASED_VERSION}`);
|
||||
|
@ -378,6 +385,72 @@ export class Toml {
|
|||
}
|
||||
}
|
||||
|
||||
/** Utility class to handle Cargo.lock file related operations */
|
||||
export class LockFile {
|
||||
/** Cargo lock file name */
|
||||
static #CARGO_LOCK = "Cargo.lock";
|
||||
|
||||
/** Replace the Cargo.lock with the given version's cached lock file */
|
||||
static async replace(version: Version) {
|
||||
// Remove Cargo.lock
|
||||
try {
|
||||
await fs.rm(this.#CARGO_LOCK);
|
||||
} catch {}
|
||||
|
||||
// `unreleased` version shouldn't have a cached lock file
|
||||
if (version !== "unreleased") {
|
||||
const lockFile = await fs.readFile(this.#getLockPath(version));
|
||||
await fs.writeFile(this.#CARGO_LOCK, lockFile);
|
||||
}
|
||||
}
|
||||
|
||||
/** Cache the current Cargo.lock in ./locks */
|
||||
static async cache(version: Version) {
|
||||
try {
|
||||
await fs.rename(this.#CARGO_LOCK, this.#getLockPath(version));
|
||||
} catch {
|
||||
// Lock file doesn't exist
|
||||
// Run the tests to create the lock file
|
||||
const result = runAnchorTest();
|
||||
|
||||
// Check failure
|
||||
if (result.status !== 0) {
|
||||
throw new Error(`Failed to create ${this.#CARGO_LOCK}`);
|
||||
}
|
||||
|
||||
await this.cache(version);
|
||||
}
|
||||
}
|
||||
|
||||
/** Get the lock file path from the given version */
|
||||
static #getLockPath(version: Version) {
|
||||
return path.join("locks", `${version}.lock`);
|
||||
}
|
||||
}
|
||||
|
||||
/** Utility class to manage versions */
|
||||
export class VersionManager {
|
||||
/** Set the active Solana version with `solana-install init` command */
|
||||
static setSolanaVersion(version: Version) {
|
||||
const activeVersion = this.#getSolanaVersion();
|
||||
if (activeVersion === version) return;
|
||||
|
||||
spawn("solana-install", ["init", version], {
|
||||
logOutput: true,
|
||||
throwOnError: { msg: `Failed to set Solana version to ${version}` },
|
||||
});
|
||||
}
|
||||
|
||||
/** Get the active Solana version */
|
||||
static #getSolanaVersion() {
|
||||
// `solana-cli 1.14.16 (src:0fb2ffda; feat:3488713414)\n`
|
||||
const result = execSync("solana --version");
|
||||
const output = Buffer.from(result.buffer).toString();
|
||||
const solanaVersion = /(\d\.\d{1,3}\.\d{1,3})/.exec(output)![1].trim();
|
||||
return solanaVersion as Version;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Anchor version from the passed arguments.
|
||||
*
|
||||
|
@ -390,3 +463,26 @@ export const getVersionFromArgs = () => {
|
|||
? "unreleased"
|
||||
: (args[anchorVersionArgIndex + 1] as Version);
|
||||
};
|
||||
|
||||
/** Run `anchor test` command */
|
||||
export const runAnchorTest = () => {
|
||||
return spawn("anchor", ["test", "--skip-lint"]);
|
||||
};
|
||||
|
||||
/** Spawn a blocking process */
|
||||
export const spawn = (
|
||||
cmd: string,
|
||||
args: string[],
|
||||
opts?: { logOutput?: boolean; throwOnError?: { msg: string } }
|
||||
) => {
|
||||
const result = spawnSync(cmd, args);
|
||||
if (opts?.logOutput) {
|
||||
console.log(result.output.toString());
|
||||
}
|
||||
|
||||
if (opts?.throwOnError && result.status !== 0) {
|
||||
throw new Error(opts.throwOnError.msg);
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
import * as anchor from "@coral-xyz/anchor";
|
||||
import * as token from "@coral-xyz/spl-token";
|
||||
import { spawnSync } from "child_process";
|
||||
|
||||
import { Bench, IDL } from "../target/types/bench";
|
||||
import { BenchData, ComputeUnits, getVersionFromArgs } from "../scripts/utils";
|
||||
import {
|
||||
BenchData,
|
||||
ComputeUnits,
|
||||
getVersionFromArgs,
|
||||
spawn,
|
||||
} from "../scripts/utils";
|
||||
|
||||
describe(IDL.name, () => {
|
||||
// Configure the client to use the local cluster
|
||||
|
@ -111,6 +115,9 @@ describe(IDL.name, () => {
|
|||
};
|
||||
|
||||
before(async () => {
|
||||
// TODO: Check Solana version
|
||||
|
||||
// Create necessary accounts
|
||||
const tokenProgram = token.splTokenProgram({
|
||||
provider: anchor.AnchorProvider.local(),
|
||||
});
|
||||
|
@ -227,7 +234,7 @@ describe(IDL.name, () => {
|
|||
|
||||
// Compare and update compute units changes
|
||||
const version = getVersionFromArgs();
|
||||
const oldComputeUnits = bench.get(version).computeUnits;
|
||||
const oldComputeUnits = bench.get(version).result.computeUnits;
|
||||
const { needsUpdate } = bench.compareComputeUnits(
|
||||
computeUnits,
|
||||
oldComputeUnits,
|
||||
|
@ -249,7 +256,7 @@ describe(IDL.name, () => {
|
|||
|
||||
// Only update markdown files on `unreleased` version
|
||||
if (version === "unreleased") {
|
||||
spawnSync("anchor", ["run", "sync-markdown"]);
|
||||
spawn("anchor", ["run", "sync-markdown"]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"compilerOptions": {
|
||||
"types": ["mocha", "chai", "node"],
|
||||
"typeRoots": ["./node_modules/@types"],
|
||||
"lib": ["es2015", "dom"],
|
||||
"lib": ["ES6"],
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"esModuleInterop": true,
|
||||
|
|
|
@ -43,7 +43,7 @@ pushd tests && yarn && popd
|
|||
pushd examples && yarn && pushd tutorial && yarn && popd && popd
|
||||
|
||||
# Bump benchmark files
|
||||
pushd tests/bench && anchor run bump-version -- $version && popd
|
||||
pushd tests/bench && anchor run bump-version -- --anchor-version $version && popd
|
||||
|
||||
echo $version > VERSION
|
||||
|
||||
|
|
Loading…
Reference in New Issue