summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/src_script_qscriptengineagent.cpp
diff options
context:
space:
mode:
authormread <qt-info@nokia.com>2010-03-24 12:25:58 (GMT)
committermread <qt-info@nokia.com>2010-03-24 12:43:09 (GMT)
commitd0645d1792e1cbdf417a923ea071975e4390fccd (patch)
tree2697d23c3eead57aad7ca5f88f3ab2e3914168b1 /doc/src/snippets/code/src_script_qscriptengineagent.cpp
parentfa2a64ee5ec1d9e65cb0c4b984c27b56fdae0120 (diff)
downloadQt-d0645d1792e1cbdf417a923ea071975e4390fccd.zip
Qt-d0645d1792e1cbdf417a923ea071975e4390fccd.tar.gz
Qt-d0645d1792e1cbdf417a923ea071975e4390fccd.tar.bz2
QIODevice::read() and QFile::atEnd() performance improvements
atEnd improvements, since atEnd is used in published example Qt read loops. The two main ideas are to push the buffer test forward, which optimises the normal buffered case, and to cache the file size till you get to the end, which otherwise has to get the file size every 16K of data. read buffer improvements: The ring buffer structure was causing significant performance overheads. In practice QIODevice has much simpler requirements on its read buffer, and a linear buffer can be used instead. This now uses a buffer optimised to QIODevice's use of it. QIODevice read function improvements. There are a number of sub-themes here, which all are aimed at getting the normal buffered path through the code done as fast as possible. This gives greatest improvements for small reads, but it is these small reads that have the biggest problems. - removing the isSequential test, by setting a pointer to the qint64 to update and using a dummy qint64 target when isSequential, then writing through the pointer. - doing the readability check on the first read only, out of the fast path - doing the maxSize<0 test after the getchar fast path - removing the buffer isEmpty test and giving a fast exit test instead - moving arithmetic out of the fast path, so "data" and "maxSize" are now dynamically updating - for RCVT builds, ARM mode is used for the read functions because the 64-bit operations are much slower with this compiler in Thumb mode There are some other changes to read() which improve clarity: - bytesToBuffer is now always set to QIODEVICE_BUFFERSIZE. This has always been the case, its just that the logic was not clear before. - moreToRead is set to false now in the case where the request was met by a direct device read. Leaving it true in this case was pointless, and setting it true in the converse case seems dangerous because the function might iterate for a very long time, although it might meet the API semantics better and would be a change in behavior because the function used to not read more when it claimed it would. Reviewed-by: Joao Reviewed-by: Aleksandar Babic
Diffstat (limited to 'doc/src/snippets/code/src_script_qscriptengineagent.cpp')
0 files changed, 0 insertions, 0 deletions