De-inline QQmlPrivate::revisionClassInfos()

It was compiled 1152 times, with the QList::push_back alone
contributing a cumulative ~24sec to a 'ninja qtdeclarative'. There's
no reason it should be inline, so make it out-of-line.

This function was the highest non-QMetaType/non-std contributor in a
Clang -ftime-trace build of qtdeclarative.

Pick-to: 6.5
Task-number: QTBUG-97601
Change-Id: I143639168f859dc604b902647fe921332bbe49c0
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This commit is contained in:
Marc Mutz 2022-12-26 12:04:24 +01:00
parent 04a155dba4
commit 1e852bb496
2 changed files with 14 additions and 10 deletions

View File

@ -712,6 +712,19 @@ void QQmlPrivate::qmlunregister(RegistrationType type, quintptr data)
} }
} }
QList<QTypeRevision> QQmlPrivate::revisionClassInfos(const QMetaObject *metaObject,
const char *key)
{
QList<QTypeRevision> revisions;
for (int index = indexOfOwnClassInfo(metaObject, key); index != -1;
index = indexOfOwnClassInfo(metaObject, key, index - 1)) {
revisions.push_back(QTypeRevision::fromEncodedVersion(
QByteArray(metaObject->classInfo(index).value()).toInt()));
}
return revisions;
}
namespace QQmlPrivate { namespace QQmlPrivate {
template<> template<>
void qmlRegisterTypeAndRevisions<QQmlTypeNotAvailable, void>( void qmlRegisterTypeAndRevisions<QQmlTypeNotAvailable, void>(

View File

@ -799,16 +799,7 @@ namespace QQmlPrivate
QByteArray(metaObject->classInfo(index).value()).toInt()); QByteArray(metaObject->classInfo(index).value()).toInt());
} }
inline QList<QTypeRevision> revisionClassInfos(const QMetaObject *metaObject, const char *key) Q_QML_EXPORT QList<QTypeRevision> revisionClassInfos(const QMetaObject *metaObject, const char *key);
{
QList<QTypeRevision> revisions;
for (int index = indexOfOwnClassInfo(metaObject, key); index != -1;
index = indexOfOwnClassInfo(metaObject, key, index - 1)) {
revisions.push_back(QTypeRevision::fromEncodedVersion(
QByteArray(metaObject->classInfo(index).value()).toInt()));
}
return revisions;
}
inline bool boolClassInfo(const QMetaObject *metaObject, const char *key, inline bool boolClassInfo(const QMetaObject *metaObject, const char *key,
bool defaultValue = false) bool defaultValue = false)