<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - STP TypedArray.subarray 5x slowdown compared to 9.1"
   href="https://bugs.webkit.org/show_bug.cgi?id=156404#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - STP TypedArray.subarray 5x slowdown compared to 9.1"
   href="https://bugs.webkit.org/show_bug.cgi?id=156404">bug 156404</a>
              from <span class="vcard"><a class="email" href="mailto:puurtuur&#64;me.com" title="Arthur Langereis &lt;puurtuur&#64;me.com&gt;"> <span class="fn">Arthur Langereis</span></a>
</span></b>
        <pre>Created <span class=""><a href="attachment.cgi?id=276133" name="attach_276133" title="Original Testcase">attachment 276133</a> <a href="attachment.cgi?id=276133&amp;action=edit" title="Original Testcase">[details]</a></span>
Original Testcase

I added the original testcase as requested by Filip. I am fine with this being included in any repository.

The Pool subtest was an experiment to see if I pre-created empty TypedArrays and then initialised them when needed was to test where the bottleneck lies. In Webkit this is a bit faster than the subarray method but e.g. in Firefox it is essentially as fast as plain array filling (with a large up-front cost but that is fine in my case.)

Up to and including 9.1, Webkit is faster or comparable in all tests to Firefox and Chrome but now it is slower in most cases except for plain JS arrays.

For Keith: the reason I'm using subarray a lot is to have a sort-of C++-like array_view where I can give a function an object that can be sub-indexed. In my framework I create interleaved vertex/index buffers that are then indexed with views. I could reorganise this that I don't pass per-vector views but it made the interface a bit simpler.

Basically, I'm doing vertex stream building and manipulation in the browser and I naively assumed that array sub-view creation would be a very lightweight operation but after your comment I understand the overhead associated with it better now.

Thanks for your efforts.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>