Skip to content

Commit

Permalink
Add finishing touches
Browse files Browse the repository at this point in the history
  • Loading branch information
lastmjs committed Aug 6, 2022
1 parent a8f1a72 commit f4f06c9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2563,7 +2563,7 @@ An attempt to estimate actual USD costs per year based on the Wasm instruction c

##### Average

These estimates use the average Wasm instructions per update function call including the function prelude.
These estimates use the average Wasm instructions per function call including the function prelude.

The Wasm instruction counts used are:

Expand Down Expand Up @@ -2629,7 +2629,7 @@ Cycle costs taken from [here](https://internetcomputer.org/docs/current/develope

###### USD Cost Estimates Per Year

These estimates use the median Wasm instructions per update function call including the function prelude.
These estimates use the median Wasm instructions per function call including the function prelude.

The Wasm instruction counts used are:

Expand Down
14 changes: 12 additions & 2 deletions benchmark/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,20 +240,30 @@ function generate_usd_cost_estimates_string(
);

const title = '## USD Cost Estimates Per Year';
const description = `These estimates use the average Wasm instructions per update function call including the function prelude from the benchmarks below.\n\nThe Wasm instruction counts used are:\n\n- Azle: ${format_number_to_rust(
const description = `These estimates use the average Wasm instructions per function call including the function prelude.\n\nThe Wasm instruction counts used are:\n\n- Azle: ${format_number_to_rust(
azle_wasm_instructions_per_update_message.toFixed(0)
)}\n- Motoko: ${format_number_to_rust(
motoko_wasm_instructions_per_update_message.toFixed(0)
)}\n- Rust: ${format_number_to_rust(
rust_wasm_instructions_per_update_message.toFixed(0)
)}`;

const cycle_costs_table_string = `
### Cycle Costs Table
Cycle costs taken from [here](https://internetcomputer.org/docs/current/developer-docs/deploy/computation-and-storage-costs/).
| Compute Percent Allocated Per Second | Update Message Execution | Ten Update Instructions Execution | Xnet Call | Xnet Byte Transmission | Ingress Message Reception | Ingress Byte Reception | GB Storage Per Second |
| ------------------------------------ | ------------------------ | --------------------------------- | --------- | ---------------------- | ------------------------- | ---------------------- | --------------------- |
| 100_000 | 590_000 | 4 | 260_000 | 1_000 | 1_200_000 | 2_000 | 127_000 |
`;

const application_scenarios_string =
generate_application_scenarios_string();
const application_costs_string =
generate_application_costs_string(usd_cost_estimates);

return `${title}\n\n${description}\n\n${application_scenarios_string}\n\n${application_costs_string}`;
return `${title}\n\n${description}\n\n${cycle_costs_table_string}\n\n${application_scenarios_string}\n\n${application_costs_string}`;
}

function generate_application_scenarios_string(): string {
Expand Down

0 comments on commit f4f06c9

Please sign in to comment.