Bug 35577

Summary: [Qt] QScriptConverter::toString() should use QVarLengthArray instead of QByteArray
Product: WebKit Reporter: Jędrzej Nowacki <jedrzej.nowacki>
Component: JavaScriptCoreAssignee: Jędrzej Nowacki <jedrzej.nowacki>
Status: RESOLVED FIXED    
Severity: Minor CC: commit-queue, jedrzej.nowacki
Priority: P3 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 34850    
Bug Blocks: 31863    
Attachments:
Description Flags
Fix v1 none

Description Jędrzej Nowacki 2010-03-02 04:27:23 PST
QScriptConverter::toString() should use the QVarLengthArray instead of the QByteArray. The QVarLengthArray uses stack memory allocation which is faster. The enhancement was suggested in bug 34850.
Comment 1 Jędrzej Nowacki 2010-03-04 05:56:02 PST
Created attachment 50008 [details]
Fix v1

The patch reduces run time of the QScriptValue::toString() about 2 ms per iteration. So it is about 3.5% speed gain in a simple benchmark like this:
{
    QScriptValue v(112312.234334);
    QBENCHMARK {
      v.toString();
    }
}
Comment 2 WebKit Commit Bot 2010-03-07 00:16:17 PST
Comment on attachment 50008 [details]
Fix v1

Clearing flags on attachment: 50008

Committed r55634: <http://trac.webkit.org/changeset/55634>
Comment 3 WebKit Commit Bot 2010-03-07 00:16:21 PST
All reviewed patches have been landed.  Closing bug.