On Apr 21, 2012, at 7:38 PM, Michael Dillon wrote:
> On Apr 19, 2012, at 2:05 PM, Jorge wrote:
>> Could you please run this gist <https://gist.github.com/1511972> and tell me
>> what it gives on the beaglebone
>
>
> Sorry this took so long to get back to but here it is running with out the
> external power adapter. I seemed to have misplaced the adapter
> in my cluttered desk.
>
> root@beaglebone:~/workspace/jorge-node-group-req# node nextTick.js
> loopsPerSecond: 6781040.2, nextTicksPerSecond: 27472.4, ratio: 246.8x times
> faster
> loopsPerSecond: 6674230.8, nextTicksPerSecond: 2000.0, ratio: 3337.1x times
> faster
> loopsPerSecond: 56.0, nextTicksPerSecond: 250.0, ratio: 0.2x times faster
> loopsPerSecond: 6571165.7, nextTicksPerSecond: 1000.0, ratio: 6571.2x times
> faster
> (...)
Thank you, Michael. This is what I get in my Mac core2-duo @ 2.53GHz:
loopsPerSecond: 103412616.3, nextTicksPerSecond: 671885.8, ratio: 153.9x times
faster
So, comparatively:
function inc () { ctr++ }
while (i--) { inc() }
loops @ about 7 million per second, that's 14 times slower, and
(function ƒ () {
inc(), process.nextTick(ƒ);
})();
loops @ about 27 thousand per second, that's 24 times less.
I suppose that the cpu caches have much to do with it, and perhaps too, the
number of optimizations in place in v8 for ARM vs. for x86, don't you think so?
In any case, it's good to know.
Thanks,
(P.S.) I've fixed the gist <https://gist.github.com/1511972> to avoid the
Infinity s.
--
Jorge.
--
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