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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 30 07:57:08 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=100754





--- Comment #2 from Yong Li <yoli at rim.com>  2012-10-30 07:58:26 PST ---
(From update of attachment 171443)
View in context: https://bugs.webkit.org/attachment.cgi?id=171443&action=review

> Source/JavaScriptCore/ChangeLog:14
> +        Add a specialized comparator for descending-numeric sorting.
> +        This improves its performance by several orders of magnitude.

any numbers?

> Source/JavaScriptCore/bytecode/CodeBlock.h:455
> +        ComparatorKind comparatorKind() { return m_comparatorKind; }

the function should be const

> Source/JavaScriptCore/runtime/JSArray.cpp:781
> +    bool operator()(const WriteBarrier<Unknown>& a, const WriteBarrier<Unknown>& b)

operator() can be either static or const. I would use static

> Source/JavaScriptCore/runtime/JSArray.cpp:870
> +static int compareByStringPairForQSort(const void* a, const void* b)
> +{
> +    const ValueStringPair* va = static_cast<const ValueStringPair*>(a);
> +    const ValueStringPair* vb = static_cast<const ValueStringPair*>(b);
> +    return codePointCompare(va->second, vb->second);
> +}

Is this function still being used?

-- 
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