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

pruntime: Box large value in OrdMap #1577

Merged
merged 2 commits into from
May 8, 2024
Merged

pruntime: Box large value in OrdMap #1577

merged 2 commits into from
May 8, 2024

Conversation

kvinwang
Copy link
Collaborator

@kvinwang kvinwang commented May 7, 2024

This PR intends to solve the stack overflow issue in pRuntime by boxing the large values in OrdMap.
In the previous implementation, we utilize OrdMap<H256, Contract> to store the contract info, where sizeof::<Contract> == 1064. Even though the size of Contract is approximately 1k, the OrdMap::insert demanded an over 8MB stack in certain scenarios. (Not sure why!)

After being boxed, it works fine when 200,000 contracts are deployed, with a 300k stack size.

@kvinwang kvinwang merged commit 9a91c53 into master May 8, 2024
8 checks passed
@kvinwang kvinwang deleted the box-ordmap-value branch May 8, 2024 03:49
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.

2 participants