Improve the speed of QDir, QFileInfo and QDirIterator.
commit44766d265c16551043d2739171069fe042c40091
authorAlexis Menard <alexis.menard@nokia.com>
Mon, 15 Jun 2009 10:09:25 +0000 (15 12:09 +0200)
committerAlexis Menard <alexis.menard@nokia.com>
Mon, 15 Jun 2009 10:14:59 +0000 (15 12:14 +0200)
tree63c5d8e8a1a01da41f8b3578f8dd919bee93fc2c
parent5d02b900f6070872a305f8405b504ecc01833de7
Improve the speed of QDir, QFileInfo and QDirIterator.

This patch basically avoid to call too often currentFileInfo in
QDirIterator. It replaces the QHash that was overkill in QFileInfo for
caching filenames. The last part is reordering the matchesFilter
to avoid stat as much as possible by using the power of && and filters
that are set on QDirIterator. And it fixes some random "mistake".

I have added a benchmark in QDir which test some use case with
10000 files in a dir.

Written-with: Benjamin
Reviewed-by: phartman
src/corelib/io/qabstractfileengine.cpp
src/corelib/io/qabstractfileengine.h
src/corelib/io/qdiriterator.cpp
src/corelib/io/qfileinfo.cpp
src/corelib/io/qfileinfo_p.h
tests/benchmarks/qdir/qdir.pro [new file with mode: 0644]
tests/benchmarks/qdir/tst_qdir.cpp [new file with mode: 0644]