Use pre-created instances when comparing flag names

Review Request #113120 - Created Oct. 5, 2013 and submitted

Information
Jan Kundrát
trojita
Reviewers
trojita
Use pre-created instances when comparing flag names

The goal here was to elliminate in-place construction of QString instances only
to be destroyed later on when they go out of scope. This change cuts the time
spent in the isMarkedAsRead when running the testFlagReSyncBenchmark test from
2.69% of the total runtime down to 0.57% (clang 3.3). It might be interesting to
see how forcing the comparison to *always* hapen *only* on QString::d would end
up :), but it's rather tricky because that's a private member, of course. That
said, soemthing along the lines of [1] (inspired by [2] which is inspired by
[3]) *might* actually work here.

Tests which attempted to use std::binary_search ended up rather poorly; it seems
that clang 3.3 was not happy enough to inilne the various std::advance and
iterator_traits calls.

[1] https://gist.github.com/dabrahams/1528856
[2] http://bloglitb.blogspot.cz/2010/07/access-to-private-members-thats-easy.html
[3] http://stackoverflow.com/a/3173080/2245623
github, branch atom-parsing-speedup
Commit Hook
Jan Kundrát
Review request changed

Status: Closed (submitted)

Loading...