Skip to content

Commit

Permalink
test(benchmark): use n/a in the benchmark table
Browse files Browse the repository at this point in the history
  • Loading branch information
smol-ninja committed Jun 27, 2024
1 parent a7e5a19 commit 364a225
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
16 changes: 8 additions & 8 deletions benchmark/BatchLockup.Gas.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ contract BatchLockup_Gas_Test is Benchmark_Test {

function gasCreateWithDurationsLD(uint256 batchSize, uint256 segmentsCount) internal {
BatchLockup.CreateWithDurationsLD[] memory params = BatchLockupBuilder.fillBatch({
batchSingle: defaults.createWithDurationsLD({
params: defaults.createWithDurationsLD({
asset_: dai,
totalAmount_: uint128(AMOUNT_PER_ITEM * segmentsCount),
segments_: _generateSegmentsWithDuration(segmentsCount)
Expand Down Expand Up @@ -86,7 +86,7 @@ contract BatchLockup_Gas_Test is Benchmark_Test {

function gasCreateWithTimestampsLD(uint256 batchSize, uint256 segmentsCount) internal {
BatchLockup.CreateWithTimestampsLD[] memory params = BatchLockupBuilder.fillBatch({
batchSingle: defaults.createWithTimestampsLD({
params: defaults.createWithTimestampsLD({
asset_: dai,
totalAmount_: uint128(AMOUNT_PER_ITEM * segmentsCount),
segments_: _generateSegments(segmentsCount)
Expand Down Expand Up @@ -114,14 +114,14 @@ contract BatchLockup_Gas_Test is Benchmark_Test {

function gasCreateWithDurationsLL(uint256 batchSize) internal {
BatchLockup.CreateWithDurationsLL[] memory params =
BatchLockupBuilder.fillBatch({ batchSingle: defaults.createWithDurationsLL(dai), batchSize: batchSize });
BatchLockupBuilder.fillBatch({ params: defaults.createWithDurationsLL(dai), batchSize: batchSize });

uint256 initialGas = gasleft();
batchLockup.createWithDurationsLL(lockupLinear, dai, params);
string memory gasUsed = vm.toString(initialGas - gasleft());

contentToAppend = string.concat(
"| `createWithDurationsLL` | Lockup Linear | |", vm.toString(batchSize), " | ", gasUsed, " |"
"| `createWithDurationsLL` | Lockup Linear | N/A |", vm.toString(batchSize), " | ", gasUsed, " |"
);

// Append the content to the file.
Expand All @@ -130,14 +130,14 @@ contract BatchLockup_Gas_Test is Benchmark_Test {

function gasCreateWithTimestampsLL(uint256 batchSize) internal {
BatchLockup.CreateWithTimestampsLL[] memory params =
BatchLockupBuilder.fillBatch({ batchSingle: defaults.createWithTimestampsLL(dai), batchSize: batchSize });
BatchLockupBuilder.fillBatch({ params: defaults.createWithTimestampsLL(dai), batchSize: batchSize });

uint256 initialGas = gasleft();
batchLockup.createWithTimestampsLL(lockupLinear, dai, params);
string memory gasUsed = vm.toString(initialGas - gasleft());

contentToAppend = string.concat(
"| `createWithTimestampsLL` | Lockup Linear | |", vm.toString(batchSize), " | ", gasUsed, " |"
"| `createWithTimestampsLL` | Lockup Linear | N/A |", vm.toString(batchSize), " | ", gasUsed, " |"
);

// Append the data to the file
Expand All @@ -146,7 +146,7 @@ contract BatchLockup_Gas_Test is Benchmark_Test {

function gasCreateWithDurationsLT(uint256 batchSize, uint256 tranchesCount) internal {
BatchLockup.CreateWithDurationsLT[] memory params = BatchLockupBuilder.fillBatch({
batchSingle: defaults.createWithDurationsLT({
params: defaults.createWithDurationsLT({
asset_: dai,
totalAmount_: uint128(AMOUNT_PER_ITEM * tranchesCount),
tranches_: _generateTranchesWithDuration(tranchesCount)
Expand Down Expand Up @@ -174,7 +174,7 @@ contract BatchLockup_Gas_Test is Benchmark_Test {

function gasCreateWithTimestampsLT(uint256 batchSize, uint256 tranchesCount) internal {
BatchLockup.CreateWithTimestampsLT[] memory params = BatchLockupBuilder.fillBatch({
batchSingle: defaults.createWithTimestampsLT({
params: defaults.createWithTimestampsLT({
asset_: dai,
totalAmount_: uint128(AMOUNT_PER_ITEM * tranchesCount),
tranches_: _generateTranches(tranchesCount)
Expand Down
40 changes: 20 additions & 20 deletions benchmark/results/SablierV2BatchLockup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@

| Function | Lockup Type | Segments/Tranches | Batch Size | Gas Usage |
| ------------------------ | --------------- | ----------------- | ---------- | --------- |
| `createWithDurationsLL` | Lockup Linear | | 5 | 771013 |
| `createWithTimestampsLL` | Lockup Linear | | 5 | 732772 |
| `createWithDurationsLL` | Lockup Linear | N/A | 5 | 771013 |
| `createWithTimestampsLL` | Lockup Linear | N/A | 5 | 732772 |
| `createWithDurationsLD` | Lockup Dynamic | 24 | 5 | 3951599 |
| `createWithTimestampsLD` | Lockup Dynamic | 24 | 5 | 3815274 |
| `createWithDurationsLT` | Lockup Tranched | 24 | 5 | 3862661 |
| `createWithTimestampsLT` | Lockup Tranched | 24 | 5 | 3744535 |
| `createWithDurationsLL` | Lockup Linear | | 10 | 1417180 |
| `createWithTimestampsLL` | Lockup Linear | | 10 | 1414248 |
| `createWithDurationsLD` | Lockup Dynamic | 24 | 10 | 7819162 |
| `createWithTimestampsLD` | Lockup Dynamic | 24 | 10 | 7585613 |
| `createWithDurationsLT` | Lockup Tranched | 24 | 10 | 7632113 |
| `createWithTimestampsLT` | Lockup Tranched | 24 | 10 | 7444113 |
| `createWithDurationsLL` | Lockup Linear | | 20 | 2783509 |
| `createWithTimestampsLL` | Lockup Linear | | 20 | 2779081 |
| `createWithDurationsLT` | Lockup Tranched | 24 | 5 | 3862651 |
| `createWithTimestampsLT` | Lockup Tranched | 24 | 5 | 3744523 |
| `createWithDurationsLL` | Lockup Linear | N/A | 10 | 1417180 |
| `createWithTimestampsLL` | Lockup Linear | N/A | 10 | 1414247 |
| `createWithDurationsLD` | Lockup Dynamic | 24 | 10 | 7819165 |
| `createWithTimestampsLD` | Lockup Dynamic | 24 | 10 | 7585616 |
| `createWithDurationsLT` | Lockup Tranched | 24 | 10 | 7632114 |
| `createWithTimestampsLT` | Lockup Tranched | 24 | 10 | 7444115 |
| `createWithDurationsLL` | Lockup Linear | N/A | 20 | 2783510 |
| `createWithTimestampsLL` | Lockup Linear | N/A | 20 | 2779081 |
| `createWithDurationsLD` | Lockup Dynamic | 24 | 20 | 15617207 |
| `createWithTimestampsLD` | Lockup Dynamic | 24 | 20 | 15131248 |
| `createWithDurationsLT` | Lockup Tranched | 24 | 20 | 15211892 |
| `createWithTimestampsLT` | Lockup Tranched | 24 | 20 | 14846363 |
| `createWithDurationsLL` | Lockup Linear | | 30 | 4143337 |
| `createWithTimestampsLL` | Lockup Linear | | 30 | 4148585 |
| `createWithDurationsLL` | Lockup Linear | N/A | 30 | 4143337 |
| `createWithTimestampsLL` | Lockup Linear | N/A | 30 | 4148585 |
| `createWithDurationsLD` | Lockup Dynamic | 24 | 30 | 23460912 |
| `createWithTimestampsLD` | Lockup Dynamic | 24 | 30 | 22697560 |
| `createWithDurationsLT` | Lockup Tranched | 24 | 30 | 22794686 |
| `createWithTimestampsLT` | Lockup Tranched | 24 | 30 | 22267335 |
| `createWithDurationsLL` | Lockup Linear | | 50 | 6871104 |
| `createWithTimestampsLL` | Lockup Linear | | 50 | 6893873 |
| `createWithDurationsLD` | Lockup Dynamic | 12 | 50 | 22990717 |
| `createWithTimestampsLD` | Lockup Dynamic | 12 | 50 | 22355937 |
| `createWithDurationsLT` | Lockup Tranched | 12 | 50 | 22413551 |
| `createWithTimestampsLT` | Lockup Tranched | 12 | 50 | 22006164 |
| `createWithDurationsLL` | Lockup Linear | N/A | 50 | 6871104 |
| `createWithTimestampsLL` | Lockup Linear | N/A | 50 | 6893797 |
| `createWithDurationsLD` | Lockup Dynamic | 12 | 50 | 22990726 |
| `createWithTimestampsLD` | Lockup Dynamic | 12 | 50 | 22355943 |
| `createWithDurationsLT` | Lockup Tranched | 12 | 50 | 22413554 |
| `createWithTimestampsLT` | Lockup Tranched | 12 | 50 | 22006169 |
Binary file modified bun.lockb
Binary file not shown.

0 comments on commit 364a225

Please sign in to comment.