-
Notifications
You must be signed in to change notification settings - Fork 622
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
Wasmer is slower for same length but bigger methods number #4660
Comments
Looked into this today, hoping to find some easy wins, but, sadly, there seems to be none. First, the serialized representation of both contracts actually differs -- although wasm len is the same, we store 3x more bytes in the cache for Then, I looked at the profiles, and I didn't notice anything order-of-magnitude big. There were some unnecessary clones which yielded 30% perf increase for After that, I've re-run the benchmark under wasmer1. It is faster, but there's still 20x gaps between the two contracts. |
The first and very rough LSM run for two parameters - code length and number of functions - show the following coefficients:
The accuracy looks promising. If I multiply all coefficients by 2, I get strict upper estimation for my simple dataset. I will post more details later, also need to check how it behaves for real examples, especially ones in the topic. |
This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. |
This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. |
For same contract lengths, but different number of contracts, gas spent on empty function calls differs significantly. In the both cases below contracts' size is 1.7 MB:
This is a serious issue because we currently estimate fees for function calls as
base_cost + bytes_cost * contract.len()
where coefficients are estimated by LSM. We compute them on a sample of contracts containing trivial methods usingmake_many_methods_contract
from PR #4529 mentioned above. It gives us fees for the worst case we know so far, but still it overestimates load on real contracts by ~10x.We would like to understand the cause of slowdown on Wasmer' side, because it currently blocks us from updating function call fees.
Double-check: after computing LSM, coefficients are
base_cost = 48_080_046_101, bytes_cost = 207_939_579
, and48_080_046_101 + 207_939_579 * 1.7 * 10^6 ~= 353 Tgas >= 302 Tgas
.cc @bowenwang1996 @olonho @matklad
The text was updated successfully, but these errors were encountered: