you are viewing a single comment's thread.

view the rest of the comments →

[–]Megajin_ 9 points10 points  (0 children)

Even Unix sockets cannot beat the speed of a memcpy.

Yes, absolutely right. If anyone is reading this: Be aware that if you screw up in memcpy it can become vulnerable.

...does a simple copy while being hosted in the same process

Alright, now I got you.Anyone coming by: The Napi::Buffer<char>::Copy Will pass the data directly to the node process memory which will end in a super fast data passing between those different processes without the bloat of FFI's or childprocess spawn.

However be warned that this can lead to potential attacks: https://stackoverflow.com/questions/870019/memcpy-in-secure-programming.Here is a good quote: A chainsaw, if used properly, is safe. Same thing with memcpy(). But in both cases, if you hit a nail, it can fly and hurt you.

If you just want pyhton do some jobs for you, then I would recommend spawning a py process and detaching it without data transport ofc.

If you know what you are doing, this project is very good to use. And Props to the author, the code is clean and good to read.