neon-bindings / neon

Rust bindings for writing safe and fast native Node.js modules.
https://www.neon-bindings.com/
Apache License 2.0
7.98k stars 282 forks source link

For tasks and async functions perform serde off the main thread #1033

Open kjvalencik opened 4 months ago

kjvalencik commented 4 months ago

For simplicity, async functions and tasks perform serde on the main thread. However, it would perform better to perform this blocking operation on another thread.

Maybe JsonString? It would act exactly like Json, but stop at the intermediary string. It will need some special handling for Err on serde_json::to_string. Maybe a TryFrom implementation and a neon::types::extract::Error.