[Development] QHash for Qt 6
Ville Voutilainen
ville.voutilainen at gmail.com
Fri Dec 20 15:07:18 CET 2019
On Fri, 20 Dec 2019 at 13:24, Philippe <philwave at gmail.com> wrote:
>
> >> just using std::unordered_map would have minimal effort on our side
> >> ("someone else's problem", and it's not even a random 3rd party...)
>
> std::unordered_map is before all an interface and the implemenation varies according to the library supplier.
That is not entirely correct. The standard doesn't specify mere
interfaces; the complexity requirements and validity
requirements specify far more than that. Especially in the case of
std::unordered_map, it's impossible to
implement in a way that provides better performance than what the
stdlib vendors already provide.
We *have* better hash tables in libstdc++, but their advantages over
std::unordered_map go away
due to the way unordered_map needs to work. I do agree with the rest
of what you're saying, see below.
> And X-Platorm Qt users would expect performance consistency I guess.
The performance of stdlib facilities is 95% portable, modulo bugs. But
that's why I agree with your
more salient point. Lars's hash gives us *better* portable performance
than std::unordered_map
gives us, because std::unordered_map can't be implemented with
significantly better performance.
QHash can.
More information about the Development
mailing list