Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8.2
-
None
-
## 硬件信息:
- **硬件型号:** Dell Inc. XPS 8950
- **内存:** 64.0 GiB
- **处理器:** 12th Gen Intel® Core™ i7-12700 × 20
- **显卡:** NVIDIA GeForce GTX 1650
- **磁盘容量:** 2.5 TB
## 软件信息:
- **固件版本:** 1.6.0
- **操作系统名称:** Ubuntu 24.04.2 LTS
- **操作系统内部版本:** (null)
- **操作系统类型:** 64 位
- **GNOME 版本:** 46
- **窗口系统:** X11
- **内核版本:** Linux 6.8.0-60-generic## 硬件信息: - **硬件型号:** Dell Inc. XPS 8950 - **内存:** 64.0 GiB - **处理器:** 12th Gen Intel® Core™ i7-12700 × 20 - **显卡:** NVIDIA GeForce GTX 1650 - **磁盘容量:** 2.5 TB ## 软件信息: - **固件版本:** 1.6.0 - **操作系统名称:** Ubuntu 24.04.2 LTS - **操作系统内部版本:** (null) - **操作系统类型:** 64 位 - **GNOME 版本:** 46 - **窗口系统:** X11 - **内核版本:** Linux 6.8.0-60-generic
Description
QDateTime constructor costs nearly 100 times of computation resource in Qt 6 than Qt 5
#include <QCoreApplication> #include <QDateTime> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); qint64 utc = QDateTime::currentDateTime().toMSecsSinceEpoch(); for (int i = 0; i < 100000; ++i) { QDateTime( QDate(2025, 4, 27), QTime(16, 29, 30, 999)); } qint64 interval = QDateTime::currentDateTime().toMSecsSinceEpoch() - utc; qInfo("Interval is %lld", interval); return 0; }
The same code outputs: 'Interval is 73' in Qt 5.
In Qt 6 it outputs: Interval is 7191.
Tested on the same machine, with Ubuntu 24.04.2