176 breaking releases

new 0.179.0 Feb 20, 2025
0.177.0 Feb 13, 2025
0.171.0 Dec 19, 2024
0.167.0 Nov 28, 2024
0.14.0 Nov 24, 2021

#2109 in Web programming

Download history 1083/week @ 2024-10-29 1201/week @ 2024-11-05 704/week @ 2024-11-12 1034/week @ 2024-11-19 1184/week @ 2024-11-26 1113/week @ 2024-12-03 1587/week @ 2024-12-10 957/week @ 2024-12-17 210/week @ 2024-12-24 452/week @ 2024-12-31 814/week @ 2025-01-07 1049/week @ 2025-01-14 911/week @ 2025-01-21 1087/week @ 2025-01-28 797/week @ 2025-02-04 813/week @ 2025-02-11

3,724 downloads per month
Used in 41 crates (8 directly)

MIT license

290KB
8K SLoC

deno_ffi

This crate implements dynamic library ffi.

Performance

Deno FFI calls have extremely low overhead (~1ns on M1 16GB RAM) and perform on par with native code. Deno leverages V8 fast api calls and JIT compiled bindings to achieve these high speeds.

Deno.dlopen generates an optimized and a fallback path. Optimized paths are triggered when V8 decides to optimize the function, hence call through the Fast API. Fallback paths handle types like function callbacks and implement proper error handling for unexpected types, that is not supported in Fast calls.

Optimized calls enter a JIT compiled function "trampoline" that translates Fast API values directly for symbol calls. JIT compilation itself is super fast, thanks to tinycc. Currently, the optimized path is only supported on Linux and MacOS.

To run benchmarks:

target/release/deno bench --allow-ffi --allow-read --unstable-ffi ./tests/ffi/tests/bench.js

Dependencies

~107MB
~2M SLoC

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy