-
Notifications
You must be signed in to change notification settings - Fork 11.4k
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
Bench for Move based transfer with Gas #190
Bench for Move based transfer with Gas #190
Conversation
We probably shouldn't use Instead, I'd recommend adding a callable version of
But I recall that @lxfind had some concerns about exposing this as an entrypoint--is that right Xun? |
Ah I did not know ObjectBasics was temporary. Will try Coin::transfer |
Probably should add a new bench type for Move calls instead of adding As for transfer, I think adding a transfer function to Coin makes sense. I was more concerned exposing a generic transfer inside Transfer module. |
Gotcha--sounds like we're on the same page! |
You can specify whether to measure Order or Confirmation stages or both (default is both) with --benchmark-type |
@lxfind |
Wow good catch! |
I am guessing it's because we currently deserialize the modules to get the id. Easy win opportunity. |
Very likely. We should dig deeper |
Yes, that is a very good catch -- we should not see such a dip at the order stage. However, my main target for optimisation is certs at this point. |
…roughput-benchmark
@sblackshear
Function signature violation occurred here https://github.com/MystenLabs/fastnft/blob/main/fastx_programmability/adapter/src/adapter.rs#L368 So the current solution uses a wrapper in GAS.move. Let me know the better way to do this from Coin.move or with generics |
fastpay/src/bench.rs
Outdated
// Do I really need this TypeArg? Does not make a diff | ||
|
||
//vec![move_core_types::language_storage::TypeTag::Struct( | ||
//GasCoin::type_(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sblackshear specifying type_args did not make a difference here so I committed them.
However I reckon they might be useful when calling a generic fn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need them eventually, but punting on them until we use Coin::transfer
seems reasonable.
My bad... there were more issues with this than I anticipated. I dropped #200 which adds an adapter test to ensure that Move-powered transfers will actually work end-to-end + fixes all the problems you found. |
Thanks |
fastpay/src/bench.rs
Outdated
ObjectID::random(), | ||
SequenceNumber::new(), | ||
keypair.0, | ||
rand::thread_rng().gen_range(0..0xFFFFFF), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use a seeded RNG here? Want to make sure we get the same values across different runs.
fastpay/src/bench.rs
Outdated
// Do I really need this TypeArg? Does not make a diff | ||
|
||
//vec![move_core_types::language_storage::TypeTag::Struct( | ||
//GasCoin::type_(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need them eventually, but punting on them until we use Coin::transfer
seems reasonable.
Extending benchmark to measure Move based mass-transfers using the Gas module.
Now that we have two paths for executing transactions (Rust and Move), it's imperative that we measure the differences in performance.
This PR adds the option to exercise the Move transfer the same way we exercise the native Rust transfer.
It also incorporates module caching as this was a significant bottleneck in Adapter flow: [fastx adapter] Cache the VM to amortise module verification #192
Usage for move:
./bench --use-move {other args}
Without move (native Rust):
./bench {other args}
Results: Move vs Native (lower% is better)
Orders Only
38k vs 45k => 15.5%
Certs Only
19k vs 23k => 17%
Orders And Certs
12.5k vs 15k => 17%