Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmark Wasm via argon2 and change gas price to 150_000 per op #1120

Merged
merged 12 commits into from
Sep 30, 2021

Conversation

webmaster128
Copy link
Member

No description provided.

@webmaster128 webmaster128 changed the title Benchmark argon2 Benchmark Wasm via argon2 and change gas price to 150_000 per op Sep 29, 2021
@webmaster128 webmaster128 requested review from maurolacy and ethanfrey and removed request for maurolacy September 29, 2021 15:26
@webmaster128 webmaster128 marked this pull request as ready for review September 29, 2021 15:26
@webmaster128 webmaster128 requested a review from uint September 29, 2021 15:27
Copy link
Member

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff

millisecond. This idea is [inspired by NEAR][neargas] and we encourage you to
read their excellent docs on that topic.

In order to meet this target, we execute Argon2 in a test contract ([#1120]).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great document.

The one question I raise is the reproduceability of "this consumed 96837752 gas and took 15ms on our CI system". They may upgrade the CI sometime.

It is fine for now, but we should have a better benchmark system sometime. (Can be in a few months)

ed25519_batch_verify_one_pubkey_cost: GasConfig::calc_crypto_cost(
GasConfig::ED255219_BATCH_VERIFY_ONE_PUBKEY_FACTOR,
),
// ~154 us in crypto benchmarks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very sensible and coherent pricing now.

Copy link
Contributor

@maurolacy maurolacy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm. Only question I have is, if it's perhaps 'Teragas' instead of 'Terragas'.

@webmaster128
Copy link
Member Author

if it's perhaps 'Teragas' instead of 'Terragas'.

Absolutely! Thank you for the hint. Will update.

@webmaster128 webmaster128 merged commit 8e4e5b2 into main Sep 30, 2021
@webmaster128 webmaster128 deleted the benchmark_argon2 branch September 30, 2021 07:28
@ethanfrey
Copy link
Member

On reflection, this means that it is 150ns per wasm op?
Quite surprised it is so high

@ethanfrey
Copy link
Member

ethanfrey commented Sep 30, 2021

Oh, Terragas not Gigagas.
0.15 ns/wasm op

Much nicer 😄

1 cosmwasm gas = 1 femtosecond of execution.
That sounds like a pretty fine-grained measurement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants