Back to LinkedIn posts

LinkedIn post 439

RisingStack uses a native module to speed up its #NodeJs app.

RisingStack uses a native module to speed up its #NodeJs app.

https://lnkd.in/eTyptrqR

The module was written in #Rust to handle URL parsing faster.

Make #Rust callable from #Node in just 3 steps:
- declare function prefixed with "#[no_mangle] pub extern "
- add to Cargo.toml file a [lib] declaration with the name of the function and crate-type = ["dylib"]
- use the ffi module https://lnkd.in/eJswu6GW to call the dynamic library specifying the path and the function signature

An alternative is to use Neon: https://lnkd.in/eg5Rwj84

chart, bar chart
  • #NodeJs
  • #Rust
  • #Node