Closed DmitryAstafyev closed 1 day ago
Hello @sehz . Any chance to take a look at this issue? Sending bytes as Vec<u8>
works quite slowly as soon as there are iterating and cloning. I guess using of Buffer should give better performance, but it doesn't work with electron )
@morenol @sehz hello guys, any chance to take a look on it ? :/
Can you try upgrading https://github.com/infinyon/node-bindgen/tree/master/nj-sys? Will try take look at later part of the week
Can you try upgrading https://github.com/infinyon/node-bindgen/tree/master/nj-sys? Will try take look at later part of the week
Hello @sehz I've did make generate
(in context nj-sys
) and after once again tried to build example (which I've provided here) and run it. Unfortunately, the same result.
It's in here: https://github.com/infinyon/node-bindgen/blob/master/nj-core/src/buffer.rs. Nothing obvious yet.
@sehz @morenol hello guys. Any news?
Been busy this week. Will try to find sometime over weekend to see what's going on
@sehz sorry to ping you again. Any news?
I am trying to reproduce it. What version of node?
@sehz sorry for delay with the reply, I've missed your message. The issue comes not with node, but with electron. I've attached example to this issue. Actually it's original example from repo, but modified to be runned in the context of electron. As for running in the context of node - there are no issues at all.
@sehz @morenol Hello guys. Actually, I think here is nothing to do with ArrayBuffer
implementation. It's a restriction of electron
. As a workaround, I'm suggesting adding implementation for SafeBuffer
, which can be used without issue with electron
to send [u8]
bytes to JS context as well with minimal performance losses.
Please take a look #318
Thanks @sehz . Could you please also update it on crates.io )
@morenol can you release?
@DmitryAstafyev crates released. Is it all working for you as expected?
Issue
Panic on call
try_to_js
withnapi_status == napi_status_napi_no_external_buffers_allowed
. Looks like changes comes with electron 21 >.Probably this is related:
Reproducing
An example is created based on your example of buffer usage. Unpack and do
Error trace
buffer.zip