[Webkit-unassigned] [Bug 100754] Faster sorting of numeric arrays

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 2 14:58:30 PDT 2012


Cosmin Truta <ctruta at gmail.com> changed:

           What    |Removed                     |Added
 Attachment #171896|0                           |1
        is obsolete|                            |
 Attachment #172150|                            |review?, commit-queue?
               Flag|                            |

--- Comment #11 from Cosmin Truta <ctruta at gmail.com>  2012-11-02 14:59:54 PST ---
Created an attachment (id=172150)
 --> (https://bugs.webkit.org/attachment.cgi?id=172150&action=review)
Patch and tests

New submission, addressing Darin's comments.

(In reply to comment #10)
> (In reply to comment #9)
> > I’m not sure that this is the right way to convert from const WriteBarrier<Unknown>& to JSValue*, even though I understand this is analogous to what the function we passed to qsort did. Is there other code that does this with these same two static_cast? Could you look at existing code to see what the usual idiom is?
> I initially tried the proper conversion, i.e. "a.get().asNumber()", but the end result was slower, not sure why though. I will give it another look.

I had noticed a small performance degradation last time I used this call, so I kept the cast. Maybe something was wrong in my testing, because this time around I rerun the tests, and I saw no difference in performance between the proper conversion and the ugly cast.

(In reply to comment #9)
> It would be good to know what platform you did performance testing on, and what the results are on the other most-dissimilar platforms.

Forgot to answer that.
My reported perf improvements were obtained on an Intel i7 running Linux Mint, building JSC with gcc.
Moreover, I compared the raw performance between std::sort and qsort (in plain C++, not JSC) using clang, and I had also run in the past such comparison tests on other platforms, including Windows (both Visual C++ and MinGW). The improvements given by std::sort were visible and consistent.
My experience is not singular. See, for example: http://www.lemoda.net/c/inline-qsort-example/

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list