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

Wasmer Issue Tracking #683

Closed
yun-yeo opened this issue Feb 21, 2022 · 2 comments · Fixed by #690
Closed

Wasmer Issue Tracking #683

yun-yeo opened this issue Feb 21, 2022 · 2 comments · Fixed by #690
Assignees
Labels
bug Something isn't working wasm Wasm contract related update

Comments

@yun-yeo
Copy link
Contributor

yun-yeo commented Feb 21, 2022

Memory leak

Reusing wamser's module is definitely causing memory leak but this adoption comes from performance improvement.

When we rollback cosmwasm cache to store serialized artifact, memory leak is gone.
terra-money/cosmwasm@16eae76

Frame error (aka. Poison error)

Wasmer bump related issues

The file cache created from wasmer@v2.0.0 cannot be used from wasmer@v2.1.x or wasmer@v2.2.x.

@yun-yeo
Copy link
Contributor Author

yun-yeo commented Feb 21, 2022

CosmWasm teams benchmark result - CosmWasm/cosmwasm#657
When we revert CosmWasm cache to use serialization again, the performance degradation seems huge

Cache/instantiate from fs                                                                            
                        time:   [3.8578 ms 4.0083 ms 4.1232 ms]
                        change: [-33.227% -30.126% -27.424%] (p = 0.00 < 0.05)
                        Performance has improved.
Cache/instantiate from memory                                                                            
                        time:   [2.5783 ms 2.6381 ms 2.6863 ms]
                        change: [+3559.6% +3718.3% +3840.8%] (p = 0.00 < 0.05)
                        Performance has regressed.
Cache/instantiate from pinned memory                                                                            
                        time:   [2.5794 ms 2.6677 ms 2.7162 ms]
                        change: [+3755.9% +3851.0% +3920.2%] (p = 0.00 < 0.05)
                        Performance has regressed.

@yun-yeo yun-yeo added the wasm Wasm contract related update label Feb 21, 2022
@yun-yeo yun-yeo self-assigned this Feb 21, 2022
@yun-yeo
Copy link
Contributor Author

yun-yeo commented Feb 21, 2022

To avoid performance degradation, changed cache strategy to cache both artifact and module and refresh cached module from a background thread with cached artifact - terra-money/cosmwasm@78026fd

  • Load
    If we have refresh background thread, then just return cached module.
    If we don't have refresh background thread, then create refresh thread and return cached module.

refresh thread deserializes artifact into module and replace cached module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wasm Wasm contract related update
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant