How slow is slow?
ClosetGeek-Git opened this issue · 1 comments
You state that the wrapper is slow. Are you making this reference in comparison to other capnproto bindings? For example, how much longer long would a simple strrev (string reverse) RPC or similar call take? Are we talking nanoseconds of additional overhead, microseconds, milliseconds,...? Sorry for being too lazy to install and test myself, but I'm low on time. Thanks
I haven't measured exactly.
The slowness here is CPU time: this implementation will spend time converting between JS objects and Cap'n Proto objects in which, for each field, it has to perform a string lookup against the Cap'n Proto schema. Very roughly speaking, I'd expect the performance to be similar to JSON -- much slower than would be expected of Cap'n Proto.
If you are performing RPCs where the inputs and outputs have only a few fields (e.g. a "string reverse" RPC would input a single string and output a single string) then I think the slowness of this implementation will be irrelevant compared to the overhead of the underlying network communications.
FWIW at this time I would only recommend using this library if you need to communicate with other services that are already using Cap'n Proto, and you need to do so from Node.js.