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

Use a single execution context per wasm interface (per thread) instead of per contract #19

Merged
merged 4 commits into from
Aug 16, 2023

Conversation

linh2931
Copy link
Member

@linh2931 linh2931 commented Aug 8, 2023

Change Description

A part of eosnetworkfoundation/product#149.

Currently an execution context is created in a backend object for each contract, and cached (inside the backend) in wasm_instantiation_cache in the wasm interface object per thread. This wastes physical memory and prevents a single compiled WASM contract code shared across threads.

This PR provides an option to decouple execution context from backend, while keeps the existing behavior for backward compatibility.

Resolves AntelopeIO/leap#1456.

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

include/eosio/vm/execution_context.hpp Show resolved Hide resolved
include/eosio/vm/backend.hpp Outdated Show resolved Hide resolved
include/eosio/vm/backend.hpp Outdated Show resolved Hide resolved
include/eosio/vm/backend.hpp Show resolved Hide resolved
include/eosio/vm/backend.hpp Show resolved Hide resolved
@linh2931 linh2931 merged commit 74dd3f0 into main Aug 16, 2023
10 checks passed
@linh2931 linh2931 deleted the decouple_exec_ctx branch August 16, 2023 21:29
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.

Do not create/use/cache execution context per contract
3 participants