Hello all,
I am writing a piece of code to interface with a modbus library
(libmodbus),which should be really fast. One bottleneck is that I have to
convert a Local<Array> to uint8_t array:
> uint8_t req[req_length];
>
> Local<Array> req_arr = Local<Array>::Cast(args[1]);
>>
> struct timespec tstart, tstop;
>
> clock_gettime(CLOCK_MONOTONIC, &tstart);
>
> for (int i = 0; i < req_length; i++) {
>
> req[i] = req_arr->Get(i)->Uint32Value();
>
> }
>
> clock_gettime(CLOCK_MONOTONIC, &tstop);
>
>
According to benchmarks this piece of code takes about 1 ms with a
req_length of 80 on a Beaglebone Black (1 MHz), which really surprises me.
After some digging I found that the conversion 'Uint32Value()' consumes
most of the time. After leaving out this conversion the benchmark results
in 100 usec.
Does anyone have an idea to improve the performance of this simple
'Uint32Value' conversion?
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.