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

Add way to read more than one value at a time from WASM memory #292

Open
vaqxai opened this issue Sep 3, 2024 · 0 comments
Open

Add way to read more than one value at a time from WASM memory #292

vaqxai opened this issue Sep 3, 2024 · 0 comments

Comments

@vaqxai
Copy link

vaqxai commented Sep 3, 2024

pub fn read_shared_rw_memory_generator(producer: &WASMProducer) -> Vec<WasmInstruction> {
let mut instructions = vec![];
let header = "(func $readSharedRWMemory (type $_t_i32ri32)".to_string();
instructions.push(header);
instructions.push(" (param $p i32)".to_string());
instructions.push("(result i32)".to_string());
instructions.push(set_constant(&producer.get_shared_rw_memory_start().to_string()));
instructions.push(get_local("$p"));
instructions.push(set_constant("4"));
instructions.push(mul32());
instructions.push(add32());
instructions.push(load32(None));
instructions.push(")".to_string());
instructions
}

Only defines a way to read one value from memory at a time. This is a huge bottleneck in performance-reliant applications. Would it be possible to add another wasm function to read multiple values at a time?
e.g. accept an array of addresses and produce an array of results?

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

No branches or pull requests

1 participant