Skip to content

add vrl #1

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

jonathanpv
Copy link
Collaborator

some reason is slow


#[cfg_attr(all(target_arch = "wasm32"), export_name = "run_vrl_wasm")]
#[no_mangle]
pub unsafe extern "C" fn run_vrl(ptr: u32, len: u32) -> u32 {
Copy link
Owner

@scottopell scottopell Nov 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The step that is currently being slow is the module instantiation Module::from_file.

If you remove this run_vrl function and compile new wasm, then module instantiation becomes very quick.

I'm not quite sure why, but without this function all of the VRL bits become dead code and will be optimized away, and from a brief look at a profile it seems to spend most of its time actually compiling (eg, I see lots of calls to regalloc2::compute_liveness).

I'm not sure why I don't see similar slowness when instantiating the module in the cgo-rust project, so maybe a starting point would be to use the wasm bytes from the cgo-rust project and try to load them with the Rust api?

Both wasm bytes contain VRL and are compiled using wasmtime, so I'd expect them to be very similar

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