On my box (Core i7, Ubuntu 12.04), running the example in the d8 shell,
ia32 and x64 have almost identical performance: 23ms vs. 24ms. Maybe
node.js adds some overhead to the x64 version?
The generated machine code is pretty much the same, too.
What you've created here is mostly a memory/GC benchmark. Most of the time
is spent creating new strings and growing the array.

Generally, x64 performance is comparable to ia32, but has different
characteristics. In some cases x64 is faster, because it can use more
registers and modern instruction set extensions (though admittedly V8
doesn't make a whole lot of use of the latter). In other cases, x64 is
slower, because both its code and its data use more memory (by
definition!), so it is less efficient at caching because it fills up all
caches faster.

"Date.now()" or "new Date()" are commonly used for JS benchmarking. They
should be reliable, but they obviously have 1ms granularity, so I'd try to
make sure that my benchmark runs for 1000 ms or so to get good results.


On Fri, Feb 1, 2013 at 2:30 AM, Michael Schwartz <[email protected]> wrote:

> I don't have the answer for you, but now your benchmark may be
> encountering something else that's not related to v8's performance.
>
> You may be measuring how long it takes to load and instantiate the 64 bit
> binary, which is likely larger byte size.
>
>
>
> On Jan 31, 2013, at 2:49 PM, Dennis H <[email protected]> wrote:
>
> Hi,
>
> May be it is not exact enough, I agree. However the delta is too big to
> ignore and can be seen using time as well:
>
> (I removed the console.log and Date.now() from script)
>
>  $ time node app.js
>
> real    0m0.087s
> user    0m0.069s
> sys    0m0.017s
>
>
> $ time node64 app.js
>
> real    0m0.098s
> user    0m0.080s
> sys    0m0.017s
>
> On Thursday, January 31, 2013 2:12:28 PM UTC-8, mschwartz wrote:
>>
>> I'm not sure it's reliable to use Date.now() for benchmarking purposes.
>>
>>
>> On Jan 31, 2013, at 2:01 PM, Dennis H <[email protected]> wrote:
>>
>> Hi,
>>
>> I just tried some JS script on nodejs, which doesn't use any of nodejs
>> APIs:
>>
>> var t1 = Date.now();
>> var arr = [];
>> for (var i=0; i < 100000; i++) {
>>     arr[i] = (100 + i) + " bla ";
>> }
>> console.log('Time  ' + (Date.now()-t1));
>>
>> This turns out to consume 26ms on the 32 bit  and 33ms on the 64 bit RHEL
>> linux, which is 27% slower.
>>
>> Any idea for the reason and plans to improve?
>>
>> Thanks,
>> Dennis
>>
>> --
>> --
>> v8-users mailing list
>> [email protected]
>> http://groups.google.com/**group/v8-users<http://groups.google.com/group/v8-users>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "v8-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to v8-users+u...@**googlegroups.com.
>> For more options, visit 
>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>> .
>>
>>
>>
>>
>>
> --
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-users" 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/groups/opt_out.
>
>
>
>
>  --
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-users" 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/groups/opt_out.
>
>
>

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" 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/groups/opt_out.


Reply via email to