Skip to content

Commit

Permalink
Merge pull request #2293 from demergent-labs/benchmark_analysis
Browse files Browse the repository at this point in the history
Benchmark analysis
  • Loading branch information
lastmjs authored Dec 18, 2024
2 parents ea14a96 + 5cfae40 commit 80ad3dd
Show file tree
Hide file tree
Showing 268 changed files with 1,996 additions and 934 deletions.
63 changes: 53 additions & 10 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,37 @@ jobs:
fail-fast: false
matrix:
benchmark_group:
- { name: 'Examples', directories: './examples' }
- {
name: 'E2E Class',
directories: './tests/end_to_end/candid_rpc/class_syntax'
name: 'Stable Demo',
directories: './examples/stable/demo'
}
- {
name: 'E2E Functional',
directories: './tests/end_to_end/candid_rpc/functional_syntax'
name: 'Experimental Demo',
directories: './examples/experimental/demo'
}
- {
name: 'E2E HTTP Server',
directories: './tests/end_to_end/http_server'
name: 'Stable E2E CRPC',
directories: './examples/stable/test/end_to_end/candid_rpc'
}
- {
name: 'Property Class',
directories: './tests/property/candid_rpc/class_api'
name: 'Experimental E2E CRPC',
directories: './examples/experimental/test/end_to_end/candid_rpc'
}
- {
name: 'Experimental E2E HTTP Server',
directories: './examples/experimental/test/end_to_end/http_server'
}
- {
name: 'Stable Property CRPC',
directories: './examples/stable/test/property/candid_rpc'
}
- {
name: 'Experimental Property CRPC',
directories: './examples/experimental/test/property/candid_rpc'
}
- {
name: 'Stable Property IC API',
directories: './examples/stable/test/property/ic_api'
}
uses: ./.github/workflows/benchmark_parallel.yml
secrets:
Expand All @@ -91,11 +106,39 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LASTMJS_GITHUB_TOKEN: ${{ secrets.LASTMJS_GITHUB_TOKEN }}

create-pr:
analyze-benchmarks:
name: Analyze Benchmark Results
needs:
- squash-branches
- create-branch-prefix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.create-branch-prefix.outputs.base-branch }}

- uses: ./.github/actions/setup_node

- uses: ./.github/actions/setup_dfx

- name: Install dependencies
run: npm install

- name: Analyze benchmarks
run: npx tsx scripts/analyze_benchmarks/index.ts

- uses: ./.github/actions/commit_and_push
with:
gpg_signing_key: ${{ secrets.GPG_SIGNING_KEY }}
branch-name: ${{ needs.create-branch-prefix.outputs.base-branch }}
commit-message: 'analyze benchmark results'
create-branch: 'false'

create-pr:
needs:
- analyze-benchmarks
- create-branch-prefix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
Expand Down
42 changes: 42 additions & 0 deletions benchmarks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"0.25.0-dev": {
"stable": {
"count": 611,
"mean": 120237704.94599018,
"median": 1011216,
"standardDeviation": 1266731659.1596396,
"min": 163759,
"max": 19060732880,
"baselineWeightedEfficiencyScore": 12425390.694599018
},
"experimental": {
"count": 745,
"mean": 1026538663.6483221,
"median": 8922860,
"standardDeviation": 3031934484.2442517,
"min": 84524,
"max": 18426067752,
"baselineWeightedEfficiencyScore": 105381438.76483223
}
},
"0.25.0-alpha": {
"stable": {
"count": 624,
"mean": 101374357.53525642,
"median": 1040987,
"standardDeviation": 1192914154.3810272,
"min": 155606,
"max": 18226207933,
"baselineWeightedEfficiencyScore": 10543095.453525642
},
"experimental": {
"count": 686,
"mean": 1153922654.5932944,
"median": 8920551.5,
"standardDeviation": 3168782029.724511,
"min": 83475,
"max": 18422514685,
"baselineWeightedEfficiencyScore": 118118515.90932944
}
}
}
179 changes: 179 additions & 0 deletions benchmarks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# Benchmarks

## Version `0.25.0-dev`

<table>
<tr>
<th></th>
<th colspan="2">Stable</th>
<th colspan="2">Experimental</th>
</tr>
<tr>
<th>Metric</th>
<th>Score</th>
<th>Change</th>
<th>Score</th>
<th>Change</th>
</tr>
<tr>
<td>Baseline Weighted Efficiency</td>
<td>12_425_390</td>
<td><span style="color: red">17.85%</span></td>
<td>105_381_438</td>
<td><span style="color: green">-10.78%</span></td>
</tr>
<tr>
<td colspan="5">&nbsp;</td>
</tr>
<tr>
<th></th>
<th>Count</th>
<th></th>
<th>Count</th>
<th></th>
</tr>
<tr>
<td>Method Executions</td>
<td>611</td>
<td><span style="color: green">-2.08%</span></td>
<td>745</td>
<td><span style="color: red">8.60%</span></td>
</tr>
<tr>
<td colspan="5">&nbsp;</td>
</tr>
<tr>
<th></th>
<th>Number of Instructions</th>
<th></th>
<th>Number of Instructions</th>
<th></th>
</tr>
<tr>
<td>Mean</td>
<td>120_237_704</td>
<td><span style="color: red">18.61%</span></td>
<td>1_026_538_663</td>
<td><span style="color: green">-11.04%</span></td>
</tr>
<tr>
<td>Median</td>
<td>1_011_216</td>
<td><span style="color: green">-2.86%</span></td>
<td>8_922_860</td>
<td><span style="color: red">0.03%</span></td>
</tr>
<tr>
<td>Standard Deviation</td>
<td>1_266_731_659</td>
<td><span style="color: red">6.19%</span></td>
<td>3_031_934_484</td>
<td><span style="color: green">-4.32%</span></td>
</tr>
<tr>
<td>Min</td>
<td>163_759</td>
<td><span style="color: red">5.24%</span></td>
<td>84_524</td>
<td><span style="color: red">1.26%</span></td>
</tr>
<tr>
<td>Max</td>
<td>19_060_732_880</td>
<td><span style="color: red">4.58%</span></td>
<td>18_426_067_752</td>
<td><span style="color: red">0.02%</span></td>
</tr>

</table>

## Version `0.25.0-alpha`

<table>
<tr>
<th></th>
<th colspan="2">Stable</th>
<th colspan="2">Experimental</th>
</tr>
<tr>
<th>Metric</th>
<th>Score</th>
<th>Change</th>
<th>Score</th>
<th>Change</th>
</tr>
<tr>
<td>Baseline Weighted Efficiency</td>
<td>10_543_095</td>
<td>0.00%</td>
<td>118_118_515</td>
<td>0.00%</td>
</tr>
<tr>
<td colspan="5">&nbsp;</td>
</tr>
<tr>
<th></th>
<th>Count</th>
<th></th>
<th>Count</th>
<th></th>
</tr>
<tr>
<td>Method Executions</td>
<td>624</td>
<td>0.00%</td>
<td>686</td>
<td>0.00%</td>
</tr>
<tr>
<td colspan="5">&nbsp;</td>
</tr>
<tr>
<th></th>
<th>Number of Instructions</th>
<th></th>
<th>Number of Instructions</th>
<th></th>
</tr>
<tr>
<td>Mean</td>
<td>101_374_357</td>
<td>0.00%</td>
<td>1_153_922_654</td>
<td>0.00%</td>
</tr>
<tr>
<td>Median</td>
<td>1_040_987</td>
<td>0.00%</td>
<td>8_920_551</td>
<td>0.00%</td>
</tr>
<tr>
<td>Standard Deviation</td>
<td>1_192_914_154</td>
<td>0.00%</td>
<td>3_168_782_029</td>
<td>0.00%</td>
</tr>
<tr>
<td>Min</td>
<td>155_606</td>
<td>0.00%</td>
<td>83_475</td>
<td>0.00%</td>
</tr>
<tr>
<td>Max</td>
<td>18_226_207_933</td>
<td>0.00%</td>
<td>18_422_514_685</td>
<td>0.00%</td>
</tr>

</table>

---

_Report generated automatically by Azle_
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"async_await": {
"previous": {
"version": "0.25.0-pre-bifurcation",
"version": "0.25.0-alpha",
"benchmarks": [
{
"instructions": { "__bigint__": "140032707" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
| 2 | getRandomnessSuperIndirectly | 140_168_252 | 56_657_300 | $0.0000753355 | $75.33 | <font color="red">+154_190</font> |
| 3 | returnPromiseVoid | 140_137_414 | 56_644_965 | $0.0000753191 | $75.31 | <font color="red">+12_241</font> |

## Baseline benchmarks Azle version: 0.25.0-pre-bifurcation
## Baseline benchmarks Azle version: 0.25.0-alpha

| Id | Method Name | Instructions | Cycles | USD | USD/Million Calls |
| --- | ---------------------------- | ------------ | ---------- | ------------- | ----------------- |
Expand All @@ -22,11 +22,11 @@

**Note on calculations:**

- Cycles are calculated using the formula: base_fee + (per_instruction_fee \* number_of_instructions) + (additional_fee_per_billion \* floor(number_of_instructions / 1_000_000_000))
- base_fee: 590_000 cycles
- per_instruction_fee: 0.4 cycles
- additional_fee_per_billion: 400_000_000 cycles per billion instructions
- USD value is derived from the total cycles, where 1 trillion cycles = 1 XDR, and 1 XDR = $1.329670 (as of October 24, 2024)
- Cycles are calculated using the formula: base_fee + (per_instruction_fee \* number_of_instructions) + (additional_fee_per_billion \* floor(number_of_instructions / 1_000_000_000))
- base_fee: 590_000 cycles
- per_instruction_fee: 0.4 cycles
- additional_fee_per_billion: 400_000_000 cycles per billion instructions
- USD value is derived from the total cycles, where 1 trillion cycles = 1 XDR, and 1 XDR = $1.329670 (as of October 24, 2024)

For the most up-to-date XDR to USD conversion rate, please refer to the [IMF website](https://www.imf.org/external/np/fin/data/rms_sdrv.aspx).
For the most current fee information, please check the [official documentation](https://internetcomputer.org/docs/current/developer-docs/gas-cost#execution).
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"audio_recorder": {
"previous": {
"version": "0.25.0-pre-bifurcation",
"version": "0.25.0-alpha",
"benchmarks": [
{
"instructions": { "__bigint__": "14169770" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
| 3 | createRecording | 34_426_195 | 14_360_478 | $0.0000190947 | $19.09 | <font color="green">-498</font> |
| 4 | deleteUser | 34_118_381 | 14_237_352 | $0.0000189310 | $18.93 | <font color="red">+304</font> |

## Baseline benchmarks Azle version: 0.25.0-pre-bifurcation
## Baseline benchmarks Azle version: 0.25.0-alpha

| Id | Method Name | Instructions | Cycles | USD | USD/Million Calls |
| --- | --------------- | ------------ | ---------- | ------------- | ----------------- |
Expand All @@ -24,11 +24,11 @@

**Note on calculations:**

- Cycles are calculated using the formula: base_fee + (per_instruction_fee \* number_of_instructions) + (additional_fee_per_billion \* floor(number_of_instructions / 1_000_000_000))
- base_fee: 590_000 cycles
- per_instruction_fee: 0.4 cycles
- additional_fee_per_billion: 400_000_000 cycles per billion instructions
- USD value is derived from the total cycles, where 1 trillion cycles = 1 XDR, and 1 XDR = $1.329670 (as of October 24, 2024)
- Cycles are calculated using the formula: base_fee + (per_instruction_fee \* number_of_instructions) + (additional_fee_per_billion \* floor(number_of_instructions / 1_000_000_000))
- base_fee: 590_000 cycles
- per_instruction_fee: 0.4 cycles
- additional_fee_per_billion: 400_000_000 cycles per billion instructions
- USD value is derived from the total cycles, where 1 trillion cycles = 1 XDR, and 1 XDR = $1.329670 (as of October 24, 2024)

For the most up-to-date XDR to USD conversion rate, please refer to the [IMF website](https://www.imf.org/external/np/fin/data/rms_sdrv.aspx).
For the most current fee information, please check the [official documentation](https://internetcomputer.org/docs/current/developer-docs/gas-cost#execution).
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"blob_array": {
"previous": { "version": "0.25.0-pre-bifurcation", "benchmarks": [] },
"previous": { "version": "0.25.0-alpha", "benchmarks": [] },
"current": { "version": "0.25.0-dev", "benchmarks": [] }
}
}
Loading

0 comments on commit 80ad3dd

Please sign in to comment.