-
Notifications
You must be signed in to change notification settings - Fork 9
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
Utility to estimate RAM #67
Comments
The following code may help measuring ram usage: test_account = 'hello'
args = {
'payer': test_account,
'receiver': test_account,
'bytes': 1024*1024*2,
}
chain.push_action('eosio', 'buyrambytes', args, {test_account: 'active'})
info = chain.api.get_account('hello')
before = info['ram_usage']
args = dict()
r = chain.push_action('hello', 'testmi2', args, {'hello': 'active'})
info = chain.api.get_account('hello')
after = info['ram_usage']
logger.error('ram usage by action: %s', after - before) |
Right, I mean measuring how much RAM a table row would take inside the contract itself, to automatically buy that much RAM |
The ram costs by store a value in a table the first time is much more than other times. So it need a test I think. |
The first time extra cost is because of the scope creation I believe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would be interesting to be able to estimate on-chain RAM bytes size from Packer+Table
The text was updated successfully, but these errors were encountered: