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

Erc20 bench #1174

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Erc20 bench #1174

wants to merge 1 commit into from

Conversation

tmontaigu
Copy link
Contributor

@tmontaigu tmontaigu commented May 28, 2024

This adds benchmarks of both latency and throughput
of 4 variants of the erc20 transfer.

It also prints the PBS count of each versions.

  • "whitepaper" is the variant written in the fhevm whitepaper
  • "no_cmux" is similar to whitepaper, but uses a "boolean multiplication"
    instead of a cmux
  • "overflow" uses an overflowing_sub to remove the need for comparison
  • "safe" use both overflowing_sub and overflowing_add to make sure both
    then sender has enough money and the that the transfer won't overflow
    the receiver's money

"overflow" has the lowest latency, and second best throughput
"no_cmux" has the second lowest latenc and the best throughput

@cla-bot cla-bot bot added the cla-signed label May 28, 2024
@tmontaigu tmontaigu changed the title WIP Erc20 bench May 28, 2024
@tmontaigu tmontaigu force-pushed the tm/erc20 branch 2 times, most recently from aa30e48 to 8119357 Compare June 14, 2024 12:15
@tmontaigu tmontaigu force-pushed the tm/erc20 branch 5 times, most recently from bd28d22 to ffa778e Compare October 3, 2024 13:54
This adds benchmarks of both latency and throughput
of 4 variants of the erc20 transfer.

It also prints the PBS count of each versions.

- "whitepaper" is the variant written in the fhevm whitepaper
- "no_cmux" is similar to whitepaper, but uses a "boolean multiplication"
  instead of a cmux
- "overflow" uses an overflowing_sub to remove the need for comparison
- "safe" use both overflowing_sub and overflowing_add to make sure both
  then sender has enough money and the that the transfer won't overflow
  the receiver's money

"overflow" has the lowest latency, and second best throughput
"no_cmux" has the second lowest latenc and the best throughput
@tmontaigu tmontaigu marked this pull request as ready for review October 3, 2024 14:07
@tmontaigu tmontaigu requested a review from soonum October 3, 2024 14:47
Copy link
Contributor

@soonum soonum left a comment

Choose a reason for hiding this comment

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

There is no target in the Makefile.
Are these benchmark cannot be run on a local machine ?

println!("ERC20 transfer/{fn_name}::{type_name}: {count} PBS");
}

fn bench_transfer_latency<FheType, F>(
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these benchmarks never meant to be stored in database ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hum I think we want to store them in a database but they are not integer bench so we likely need a different database/schema and we would need to store both the throughput and latency (and pbs count if posssible)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok so we need to discuss how to add them.

@tmontaigu
Copy link
Contributor Author

tmontaigu commented Oct 3, 2024

There is no target in the Makefile.

Will add one

Are these benchmark cannot be run on a local machine

What do you mean by local ? You can run them on your laptop if you want but its not really going to be meaningfull especially for the thourhgput benches

@soonum
Copy link
Contributor

soonum commented Oct 4, 2024

What do you mean by local ? You can run them on your laptop if you want but its not really going to be meaningfull especially for the thourhgput benches

No problem, since it's just a target missing in the Makefile. I was wondering if it needed a more sophisticated infra than just one machine.

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

Successfully merging this pull request may close these issues.

2 participants