Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Issue 2190 in v8: Performance on TypedArray creation low
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
codesite-nore...@google.com  
View profile  
 More options Jun 21 2012, 5:47 am
From: codesite-nore...@google.com
Date: Thu, 21 Jun 2012 09:47:41 +0000
Local: Thurs, Jun 21 2012 5:47 am
Subject: Issue 2190 in v8: Performance on TypedArray creation low
Status: New
Owner: ----

New issue 2190 by timm.dre...@gmail.com: Performance on TypedArray creation  
low
http://code.google.com/p/v8/issues/detail?id=2190

Reading and writing to and from existing TypedArrays very fast:
- http://jsperf.com/typedarray-read/2
- http://jsperf.com/typedarray-write/3

But in contrast creating a new TypedArray is very slow:
- http://jsperf.com/typedarray-create

This is a killer for scenarios when you are using temporary objects inside  
the functions (Native) in contrast of using an external singleton as  
temporary object (TempObj):
- http://jsperf.com/typedarray-lookat/3

if you are using temporary Arrays inside the function (Mixture / Mixture  
TempObj) it doesn't result in a huge performance decrease.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile  
 More options Jun 25 2012, 7:45 am
From: codesite-nore...@google.com
Date: Mon, 25 Jun 2012 11:45:05 +0000
Local: Mon, Jun 25 2012 7:45 am
Subject: Re: Issue 2190 in v8: Performance on TypedArray creation low
Updates:
        Status: WorkingAsIntended

Comment #1 on issue 2190 by yang...@chromium.org: Performance on TypedArray  
creation low
http://code.google.com/p/v8/issues/detail?id=2190

This issue is neither new nor limited to Chrome (as can be seen on jsperf).  
The reason is simply that while constructing Array is done exclusively in  
the Javascript virtual machine and an allocation in the VM's heap,  
constructing a TypedArray involves the browser binding (at least in Chrome)  
and allocation outside the VM's heap. The former can be properly optimized,  
while the latter cannot. Future optimizations in this area are already on  
our radar, but have rather low priority.

The performance difference you see in your read benchmark can simply be  
explained by the Array object being uninitialized. Out-of-bound accesses  
are inherently slow. I revised your read access benchmark -  
http://jsperf.com/typedarray-read/3
The same applies to the write access benchmark: sequential out-of-bound  
writes require the array length to be changed every time. Random write  
accesses causes the VM to represent the array as a hashtable rather than a  
real array in the memory. Those issues do not affect typed arrays since  
those are simply allocated as a memory block in the heap.

Generally speaking, typed arrays are good if you want to allocate a  
long-living dense array with a certain type and size. Array objects are  
better if you want to create temporary arrays often.

However, I would advise against micro-benchmarks like those on jsperf as  
those rarely show real-world performance. Javascript VMs nowadays are tuned  
with intricate heuristics that often work well for comprehensive  
applications, but not for micro-benchmarks that stress one small test case.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
codesite-nore...@google.com  
View profile  
 More options Oct 11 2012, 6:57 pm
From: codesite-nore...@google.com
Date: Thu, 11 Oct 2012 22:57:22 +0000
Local: Thurs, Oct 11 2012 6:57 pm
Subject: Re: Issue 2190 in v8: Performance on TypedArray creation low

Comment #2 on issue 2190 by pie...@gmail.com: Performance on TypedArray  
creation low
http://code.google.com/p/v8/issues/detail?id=2190

This really is a shame. it would seem that typed, fixed-length arrays  
should be much faster than regular JS arrays. TypedArrays (large and small)  
are used throughout WebGL.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »