diff options
author | Lars Knoll <lars.knoll@digia.com> | 2012-12-13 23:46:51 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-12-14 09:09:55 +0100 |
commit | 21d90ca005700fe01bddda28b94db32421d59808 (patch) | |
tree | 6dc30ff41bcab647e5835a4f539950159381d578 /qv4mm.h | |
parent | 2761c4ceacab2e4f7da2e2a293a895595c02a928 (diff) |
Fix quadratic behavior in the memory manager
The old freeList implementation was causing quadratic
behavior in alloc(), as the free item ended up in the
highest chunk.
The new implementation uses a fixed size array for small objects
(up to 256 bytes), a QMap for large chunks, and a defaultFree
object pointing to the heap that has never been used before.
Gives around 25% performance boost on crypto.js, and bsaically
makes the memory manager invisible in kcachegrind.
Change-Id: I559fb527bcd9e21d4ac265f4d78b8376bfda2522
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'qv4mm.h')
-rw-r--r-- | qv4mm.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -153,6 +153,8 @@ protected: void willAllocate(std::size_t size); #endif // DETAILED_MM_STATS + MMObject *splitItem(MMObject *m, int newSize); + private: void collectRoots(QVector<VM::Object *> &roots) const; static std::size_t mark(const QVector<Object *> &objects); |