diff options
author | Robin Burchell <robin.burchell@viroteck.net> | 2015-01-08 01:28:58 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2015-01-09 11:51:28 +0100 |
commit | 6421f275286b3238fe1a7a5e909225251f3e8dbf (patch) | |
tree | e91388f7e70d3d2c4d3542701bb573988b7a5a10 /src/qml/qml/qqmlpropertycache.cpp | |
parent | 2a375c3f54da8bbf637880ea89f4e7e9937bdb26 (diff) |
Replace InternalClass transitions hash with a sorted vector.
In a reasonable test application, there were some 1697 transition entries. Out
of these, 1663 of them had only a single item. The remainder, with the exception
of three, had <10 items. Only one of these had a count of >50 items (86).
As can be seen, most of the time, transitions is usually quite sparsely
populated, so using a hash is a large amount of overhead considering there's
just a few elements. For the times when it isn't, the vector being sorted
should help take care of that.
Since transitions are never removed, we can use a similar trick to
ba690fb73864915b4a35bbec5b7dc134ff1dafd0 and use a sorted vector to store them.
Compared to the hash approach, this saved ~412kb according to malloc_stats on a
reasonably comprehensive test application. Coincidentally, this also improved
v8bench for me by ~10%.
Note that this undoes 132cdfa69cae45d0c02ea715ce58722bbcd57e73, but the
expectation is that the fewer allocations done by using a vector will outweigh
the need to reserve any specific allocation initially.
Change-Id: Iec57a7db7e9a60347c9683b1cb1598f6d9c866f7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlpropertycache.cpp')
0 files changed, 0 insertions, 0 deletions