@fluffelpuffcode Then you’ll also need to supply an argument in the parentheses as well, which is a reference to a context. There’s usually a variable in scope called `cx` in idiomatic Neon code, which would get you what you want there.
In my latest post I'm writing about procedures to improve @nodejs Lambda performance with the usage of @rustlang and @RustNeon .
You can find the blog post in DEV: https://t.co/g9OlxdIrRf
Hope you will enjoy it😉
#AWSCommunityBuilders@awsdevelopers
@dfrasca80@tokio_rs Some tips for performance, based on a quick review of the code:
- Creating a separate executor for every call is expensive, instead of sharing a single executor.
- Exposing I/O synchronously blocks the JS event loop. You might consider reframing your module as a promise API.
@dfrasca80@tokio_rs Congrats on your native module! Feel free to join the community Slack if you'd like help optimizing the code. We can also look into making an example of using Tokio with Neon.
@dfrasca80 Agreed! Fixing the footer is just a first step but we'll still prioritize redoing the legacy examples for the latest versions of Neon. We won't remove the legacy branch until it's truly obsoleted.
@DTRomesh@gitconnected Nice article, thank you for sharing! BTW, the IRC channel is no longer active; these days we encourage anyone interested in community discussion to join our Slack channel. Thanks again for the great writeup!
@hawkticehurst @kdy1dev@Brooooook_lyn For a compiler for the web ecosystem it could be useful to offer both prebuilt binary for ease of use + maximum performance, but also offer a Node API for programmatic use cases. Either @RustNeon or napi-rs should work for you & we’d be happy to help if you have questions!