varfish-org / mehari

VEP-like tool for sequence ontology and HGVS annotation of VCF files
MIT License
14 stars 1 forks source link

feat: Plugin system (#426) #433

Open tedil opened 2 months ago

tedil commented 2 months ago

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.

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 commented 2 months ago

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.