diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2011-09-14 12:15:07 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-15 20:39:28 +0200 |
commit | 4cd9d267e727b0b146f0f2d5b41cf62c97145fb4 (patch) | |
tree | 272f0d0143ad2470c9a875fee62cd3ecdf553f6a /src/corelib/tools/qchar.cpp | |
parent | 6e557155810505525ec976cf7b9421e5c8970b55 (diff) |
Boost performance of QChar::is{Upper,Lower}
Calling QChar::category() is slow; do some fast checks to
detect ascii characters before falling back to the generic
handling.
On ia32, this change makes isUpper ~260x faster for uppercase
ascii characters, and ~180x faster for non-uppercase ascii
characters. Similar numbers for isLower.
Even with the additional checks, these versions are slightly
faster than before for non-ascii characters as well, since
we now call the static fastcall category(ushort) function,
which is faster than the category() member function (which
uses the stack to pass the unicode value).
Change-Id: I6ae0df466bb4835ca0d5319fd6018862c849313b
Reviewed-on: http://codereview.qt-project.org/4901
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/tools/qchar.cpp')
0 files changed, 0 insertions, 0 deletions