QV4::InternalClass: reserve space for transitions.
authorRobin Burchell <robin.burchell@viroteck.net>
Thu, 18 Dec 2014 11:43:18 +0000 (12:43 +0100)
committerRobin Burchell <robin.burchell@viroteck.net>
Wed, 31 Dec 2014 04:07:08 +0000 (05:07 +0100)
Profiling of allocations shows that this is one of the most frequent allocators.

Change-Id: Iae0350c61bfe37381577642b9a93064377f45c1d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/jsruntime/qv4internalclass.cpp

index 0f88dd4..c226cea 100644 (file)
@@ -125,6 +125,7 @@ InternalClass::InternalClass(ExecutionEngine *engine)
     , m_frozen(0)
     , size(0)
 {
+    transitions.reserve(17);
 }
 
 
@@ -140,6 +141,7 @@ InternalClass::InternalClass(const QV4::InternalClass &other)
     , m_frozen(0)
     , size(other.size)
 {
+    transitions.reserve(17);
 }
 
 void InternalClass::changeMember(Object *object, String *string, PropertyAttributes data, uint *index)