summaryrefslogtreecommitdiff
path: root/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2022-04-21 10:45:47 +0200
committerMarco Bubke <marco.bubke@qt.io>2022-05-24 16:03:03 +0000
commit69858337da0b6b007c39c5aa17e0ec3d9d5ed228 (patch)
tree2c3bcef8f4f772e70c5643e39a9f396c7c106c01 /src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h
parent056db316f926607db0922d03746f91317410ad66 (diff)
downloadqt-creator-69858337da0b6b007c39c5aa17e0ec3d9d5ed228.tar.gz
QmlDesigner: Use TypeNameString instead of Utils::SmallString
It increases the small string optimization area. Many of the type names are longer than the SSO area of Utils::SmallString so we use a custom String for types which has a larger SSO area. So there a much less mallocs. This should improve performance a little but but uses a little bit more memory. Change-Id: I6a2225f21fb16afc8379868f3f18f38ae6ad0cd8 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h')
-rw-r--r--src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h b/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h
index 4fd92a9475..f025babdb0 100644
--- a/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h
+++ b/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h
@@ -43,6 +43,8 @@ constexpr std::underlying_type_t<Enumeration> to_underlying(Enumeration enumerat
return static_cast<std::underlying_type_t<Enumeration>>(enumeration);
}
+using TypeNameString = Utils::BasicSmallString<63>;
+
} // namespace QmlDesigner
namespace QmlDesigner::Storage {
@@ -310,7 +312,7 @@ public:
}
public:
- Utils::SmallString name;
+ TypeNameString name;
};
class QualifiedImportedType
@@ -328,7 +330,7 @@ public:
}
public:
- Utils::SmallString name;
+ TypeNameString name;
Import import;
};
@@ -459,7 +461,7 @@ public:
}
public:
- Utils::SmallString name;
+ TypeNameString name;
EnumeratorDeclarations enumeratorDeclarations;
};
@@ -509,7 +511,7 @@ public:
public:
Utils::SmallString name;
- Utils::SmallString typeName;
+ TypeNameString typeName;
PropertyDeclarationTraits traits = {};
};
@@ -584,7 +586,7 @@ public:
public:
Utils::SmallString name;
- Utils::SmallString returnTypeName;
+ TypeNameString returnTypeName;
ParameterDeclarations parameters;
};
@@ -806,7 +808,7 @@ public:
}
public:
- Utils::SmallString typeName;
+ TypeNameString typeName;
ImportedTypeName prototype;
ExportedTypes exportedTypes;
PropertyDeclarations propertyDeclarations;