Details
-
Suggestion
-
Resolution: Invalid
-
P1: Critical
-
None
-
None
Description
Overview
For QML, the existing QObject metasystem requires an order of magnitude performance improvement in the following areas:
- QObject construction and destruction time
- Assigning a QObject parent
- Making a by-index (ie. QMetaObject::connect()) signal/slot connection
- Emitting an unconnected signal
- Emitting a connected signal
QML itself does not require improvements in any of these areas. Any improvements here will only very marginally improve overall performance.
- QObject::connect() performance
- QMetaObject::indexOf*() performance
Unnecessary features
QML does not use, and would thus prefer not to pay for, the following QObject features:
- Object thread-affinity
- Thread-safe connections
- Object name
- QEvent's and event filters
Memory Allocation
The two major costs in the current QObject implementation are threading support, and excessive memory allocation. QML can help reduce memory allocation in several ways:
- QML knows ahead of time the number of objects, their types and their in-memory size it is going to allocate. QML can allocate memory for these objects in one operation, instead of the current n allocations.
- If required, QML can provide additional pooled memory to most QObject operations it uses. For example, QML can batch allocate the internal Connection structures.
- All QML objects currently require a QDeclarativeData allocation to store QML specific information. This structure should be merged with QObjectPrivate.