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

feat: Plugin system (#426) #433

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

feat: Plugin system (#426) #433

wants to merge 5 commits into from

Conversation

tedil
Copy link
Contributor

@tedil tedil commented Apr 10, 2024

This draft PR adds a plugin system based on extism (#426). To that end, the project is converted to a workspace with (currently) three members: mehari, mehari-plugins and mehari-plugin-vep-nmd.

  • mehari remains unchanged
  • mehari-plugins currently contains stubs mimicking VEP's tva data structure, while mehari-plugin-vep-nmd contains a translation of VEP's NMD plugin to rust code.
  • mehari-plugin-vep-nmd has a different build-target (wasm32-unknown-unknown) than the other workspace members, and, as such, it has a corresponding .cargo/config.toml file.

However, workspaces do not support having different targets (yet), so cargo will build all workspace members for the default target. To actually get a WASM binary for the plugin, explicitly execute cargo build in the mehari-plugin-vep-nmd directory.
(Could probably be done with a Makefile or something similar, at least until the different-targets-per-workspace-member feature hits stable)

@tedil tedil changed the title feature: Plugin system (#426) feat: Plugin system (#426) Apr 10, 2024
@tedil tedil self-assigned this Apr 10, 2024
@tedil
Copy link
Contributor Author

tedil commented Apr 11, 2024

I added a little criterion benchmark comparing calling a compiled wasm plugin and doing the same* work natively, here are some first insights:

  1. calling the NMD WASM plugin: 10µs / repeat
  2. performing NMD annotation natively: 70ns / repeat
  3. performing NMD annotation natively + artificially (de-)serializing and cloning the input data: 2µs

i.e. some time is spent on serde to/from json, some time is spent on cloning, some time is spent on WASM overhead I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Discussion/Feedback
Development

Successfully merging this pull request may close these issues.

1 participant