<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>70687</bug_id>
          
          <creation_ts>2011-10-22 18:57:08 -0700</creation_ts>
          <short_desc>Typed arrays are 10X slower than normal classic arrays</short_desc>
          <delta_ts>2013-12-13 10:41:10 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>OS X 10.7</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://jsperf.com/read-write-typed-arrays/2</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P3</priority>
          <bug_severity>Minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Joseph Huckaby">jhuckaby</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>cmarcelo</cc>
    
    <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>m.goleb+bugzilla</cc>
    
    <cc>oliver</cc>
    
    <cc>shezbaig.wk</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>488982</commentid>
    <comment_count>0</comment_count>
    <who name="Joseph Huckaby">jhuckaby</who>
    <bug_when>2011-10-22 18:57:08 -0700</bug_when>
    <thetext>Using a simple for loop reading and writing single values from typed arrays vs. normal arrays, the performance difference is staggering.  Typed arrays are all about 10X slower than normal arrays.  This strange behavior only occurs in Safari (running the very same test in Chrome and Firefox the typed arrays win outright, as they should).

See the test page for details and source code: http://jsperf.com/read-write-typed-arrays/2

Reproduced in Safari 5.1, 5.11 and WebKit Nightly Build (Oct 18 2011) on OS X 10.7.2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>489518</commentid>
    <comment_count>1</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2011-10-24 12:11:51 -0700</bug_when>
    <thetext>&lt;rdar://problem/10335308&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>489524</commentid>
    <comment_count>2</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2011-10-24 12:19:22 -0700</bug_when>
    <thetext>Yeah, we know about this.  The problem is essentially that WebKit still uses DOM-based typed arrays, which leads to most of the perf issues we see here (essentially they get the worst performance it is possible to achieve in JSC currently).

Fix is non-trivial, but it also won&apos;t be the hardest thing in the world to achieve.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>489527</commentid>
    <comment_count>3</comment_count>
    <who name="Joseph Huckaby">jhuckaby</who>
    <bug_when>2011-10-24 12:23:35 -0700</bug_when>
    <thetext>Cool, thanks guys.  I figured you had to know about it, just didn&apos;t see it in Bugzilla :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>959544</commentid>
    <comment_count>4</comment_count>
    <who name="Michał Gołębiowski-Owczarek">m.goleb+bugzilla</who>
    <bug_when>2013-12-13 04:49:37 -0800</bug_when>
    <thetext>I don&apos;t see any slowdown in Safari 7.0, has this issue been fixed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>959567</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2013-12-13 09:24:05 -0800</bug_when>
    <thetext>This particular bug is believed to have been fixed in Safari 6. There were many additional optimizations afterwards, including a rewrite that happened recently, after Safari 7.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>959573</commentid>
    <comment_count>6</comment_count>
    <who name="Joseph Huckaby">jhuckaby</who>
    <bug_when>2013-12-13 10:03:51 -0800</bug_when>
    <thetext>I can confirm the speed has greatly improved in Safari 6.1 (I don&apos;t have 7 yet).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>959584</commentid>
    <comment_count>7</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2013-12-13 10:32:26 -0800</bug_when>
    <thetext>Could you please test with Safari 6.1 and nightly build, as well? 

http://nightly.webkit.org</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>959586</commentid>
    <comment_count>8</comment_count>
    <who name="Michał Gołębiowski-Owczarek">m.goleb+bugzilla</who>
    <bug_when>2013-12-13 10:41:10 -0800</bug_when>
    <thetext>In the test under http://jsperf.com/read-write-typed-arrays/2 WebKit Nightly is faster than Safari 7, especially in Uint32Array tests.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>