Did you mean command strace -c -e "gettimeofday,clock_gettime" node 3.js ?
Old (on a more powerful desktop pc):
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
13220 wicked 20 0 2104 508 428 S 66 0.0 7:46.70 strace
13221 wicked 20 0 33144 9036 4136 R 41 0.1 4:42.47 node
wicked@wicked-desktop:~/Alawar$ time strace -c -e
"gettimeofday,clock_gettime" node 3.js
^C% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00 0.799649 0 47083893 gettimeofday
0.00 0.000000 0 6 1 clock_gettime
------ ----------- ----------- --------- --------- ----------------
100.00 0.799649 47083899 1 total
real 22m28.796s
user 2m5.124s
sys 12m45.256s
As you can see I ctrl+c'ed the process after 22 minutes.
New (on a weaker laptop):
wicked@wnote:~$ time strace -c -e "gettimeofday,clock_gettime" node 3.js
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
-nan 0.000000 0 3 clock_gettime
------ ----------- ----------- --------- --------- ----------------
100.00 0.000000 3 total
real 0m8.761s
user 0m8.741s
sys 0m0.016s
The difference is obvious :)
понедельник, 29 октября 2012 г., 19:38:37 UTC+7 пользователь Ben Noordhuis
написал:
On Mon, Oct 29, 2012 at 6:15 AM, Alexey Kupershtokh
<alexey.ku...@gmail.com <javascript:>> wrote:
I've found an extreme solution:
I upgraded ubuntu from
Ubuntu 12.04.1 LTS \n \l;
Linux wnote 3.2.0-33-generic-pae #52-Ubuntu SMP Thu Oct 18 16:39:21 UTC 2012
i686 i686 i386 GNU/Linux
to
Ubuntu 12.10 \n \l;
Linux wnote 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012
x86_64 x86_64 x86_64 GNU/Linux
And performance increased 15-20 times to these numbers:
Chrome 22: 10,946,261
FF 16: 15,301,293
Node 0.8.14: 11,671,335
Differences are:
ubuntu: 12.04 -> 12.10
kernel: 3.2.0-33 -> 3.5.0-17
arch: i686 + pae (32 bit) -> x86_64 (64 bit)
I don't know which one matters, but it's a subject for further
investigation.
It's probably glibc/VDSO changes. I wager that when you trace your
benchmark with `strace -c gettimeofday,clock_gettime`, you'll see a
ton of hits on your old system and hardly any on your new system.
--
Job Board:
http://jobs.nodejs.org/Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-GuidelinesYou received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to
nodejs@googlegroups.comTo unsubscribe from this group, send email to
nodejs+
unsubscribe@googlegroups.comFor more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en