Thanks! That helped remove the resize operation from the profiling data, but QBuffer::writeData is still there, and the overall time didn't change much.
Is there anything else I can look at, or is this a dead end then - requires a different serialization solution altogether (a lot of work)? On Sun, Apr 22, 2018 at 4:53 PM Giuseppe D'Angelo <giuseppe.dang...@kdab.com> wrote: > Il 22/04/2018 16:30, Vadim Peretokin ha scritto: > > A lot of time seems to be spent resizing the buffer, and unfortunately > > there doesn't seem to be a way to pre-set the QBuffer size to something > > reasonable to begin with. > > > > Anyone have tips? > > Didn't check the actual code, but you can always resize a QBuffer > internal bytearray: > > QBuffer b; > b.buffer().resize(1234); // or reserve() > > HTH, > > -- > Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer > KDAB (France) S.A.S., a KDAB Group company > Tel. France +33 (0)4 90 84 08 53 <+33%204%2090%2084%2008%2053>, > http://www.kdab.com > KDAB - The Qt, C++ and OpenGL Experts > > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest >
"Function","CPU Time: Total","CPU Time: Self","Module","Function (Full)","Source File","Start Address" "QEventLoop::exec","0.27","0","libQt5Core.so.5","QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)","[Unknown]","0x27d7b0" "main","0.26","0","mudlet","main","main.cpp","0x6cdf0" "func@0xd8b70","0.26","0","libQt5XcbQpa.so.5","func@0xd8b70","[Unknown]","0xd8b70" "__libc_start_main","0.26","0","libc.so.6","__libc_start_main","libc-start.c","0x210d0" "_start","0.26","0","mudlet","_start","[Unknown]","0x72500" "QCoreApplication::exec","0.26","0","libQt5Core.so.5","QCoreApplication::exec(void)","[Unknown]","0x2863a0" "QCoreApplication::notifyInternal2","0.25","0","libQt5Core.so.5","QCoreApplication::notifyInternal2(QObject*, QEvent*)","[Unknown]","0x27ef20" "QApplication::notify","0.25","0","libQt5Widgets.so.5","QApplication::notify(QObject*, QEvent*)","[Unknown]","0x160760" "QApplicationPrivate::notify_helper","0.25","0","libQt5Widgets.so.5","QApplicationPrivate::notify_helper(QObject*, QEvent*)","[Unknown]","0x1595a0" "func@0x1b22b0","0.21","0","libQt5Widgets.so.5","func@0x1b22b0","[Unknown]","0x1b22b0" "TCommandLine::event","0.21","0","mudlet","TCommandLine::event(QEvent*)","TCommandLine.cpp","0x3164a0" "TCommandLine::enterCommand","0.21","0","mudlet","TCommandLine::enterCommand(QKeyEvent*)","TCommandLine.cpp","0x315ad0" "lua_pcall","0.21","0","liblua5.1.so.0","lua_pcall","[Unknown]","0x83a0" "Host::send","0.21","0","mudlet","Host::send(QString, bool, bool)","Host.cpp","0x27de20" "AliasUnit::processDataStream","0.21","0","mudlet","AliasUnit::processDataStream(QString const&)","AliasUnit.cpp","0x18dd10" "QGuiApplicationPrivate::processKeyEvent","0.21","0","libQt5Gui.so.5","QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*)","[Unknown]","0x12ef30" "QGuiApplicationPrivate::processWindowSystemEvent","0.21","0","libQt5Gui.so.5","QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*)","[Unknown]","0x133fd0" "QWindowSystemInterface::sendWindowSystemEvents","0.21","0","libQt5Gui.so.5","QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)","[Unknown]","0x10f770" "TAlias::match","0.21","0","mudlet","TAlias::match(QString const&)","TAlias.cpp","0x2ee310" "TAlias::execute","0.21","0","mudlet","TAlias::execute(void)","TAlias.cpp","0x2edff0" "TLuaInterpreter::call","0.21","0","mudlet","TLuaInterpreter::call(QString const&, QString const&)","TLuaInterpreter.cpp","0x33ac00" "TLuaInterpreter::saveProfile","0.21","0","mudlet","TLuaInterpreter::saveProfile(lua_State*)","TLuaInterpreter.cpp","0x3428c0" "Host::saveProfile","0.21","0","mudlet","Host::saveProfile(QString const&, bool)","Host.cpp","0x281540" "XMLexport::exportHost","0.21","0","mudlet","XMLexport::exportHost(QIODevice*)","XMLexport.cpp","0x3cdf50" "XMLexport::writeHost","0.21","0.0119786","mudlet","XMLexport::writeHost(Host*)","XMLexport.cpp","0x3ca2b0" "XMLexport::writeTrigger","0.190025","0","mudlet","XMLexport::writeTrigger(TTrigger*)","XMLexport.cpp","0x3c81d0" "QIODevice::write","0.0859903","0.0380301","libQt5Core.so.5","QIODevice::write(char const*, long long)","[Unknown]","0x1ad360" "QXmlStreamWriter::writeTextElement","0.0820083","0","libQt5Core.so.5","QXmlStreamWriter::writeTextElement(QString const&, QString const&)","[Unknown]","0x3130a0" "func@0x312d60","0.0740144","0.00799232","libQt5Core.so.5","func@0x312d60","[Unknown]","0x312d60" "QXmlStreamWriter::writeStartElement","0.0740144","0","libQt5Core.so.5","QXmlStreamWriter::writeStartElement(QString const&)","[Unknown]","0x313050" "func@0x310fe0","0.0740075","0.00799641","libQt5Core.so.5","func@0x310fe0","[Unknown]","0x310fe0" "QEventDispatcherGlib::processEvents","0.06","0","libQt5Core.so.5","QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)","[Unknown]","0x2d3150" "g_main_context_iteration","0.06","0.02","libglib-2.0.so.0","g_main_context_iteration","[Unknown]","0x4b250" "func@0x3111b0","0.0580279","0","libQt5Core.so.5","func@0x3111b0","[Unknown]","0x3111b0" "QXmlStreamWriter::writeEndElement","0.0519839","0","libQt5Core.so.5","QXmlStreamWriter::writeEndElement(void)","[Unknown]","0x311850" "QBuffer::writeData","0.0479601","0.0319937","libQt5Core.so.5","QBuffer::writeData(char const*, long long)","[Unknown]","0x18f650" "func@0x3107e0","0.0440052","0.00799832","libQt5Core.so.5","func@0x3107e0","[Unknown]","0x3107e0" "func@0x16894e","0.04","0","libQt5Widgets.so.5","func@0x16894e","[Unknown]","0x16894e" "func@0x168c40","0.04","0","libQt5Widgets.so.5","func@0x168c40","[Unknown]","0x168c40" "QWidgetPrivate::syncBackingStore","0.04","0","libQt5Widgets.so.5","QWidgetPrivate::syncBackingStore(void)","[Unknown]","0x17f290" "QWidget::event","0.04","0","libQt5Widgets.so.5","QWidget::event(QEvent*)","[Unknown]","0x195e20" "QMainWindow::event","0.04","0","libQt5Widgets.so.5","QMainWindow::event(QEvent*)","[Unknown]","0x2a2e60" "QWidgetPrivate::drawWidget","0.04","0","libQt5Widgets.so.5","QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*)","[Unknown]","0x18efb0" "QWidgetPrivate::paintSiblingsRecursive","0.04","0","libQt5Widgets.so.5","QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList<QObject*> const&, int, QRegion const&, QPoint const&, int, QPainter*, QWidgetBackingStore*)","[Unknown]","0x18ff80" "QWidgetPrivate::sendPaintEvent","0.04","0","libQt5Widgets.so.5","QWidgetPrivate::sendPaintEvent(QRegion const&)","[Unknown]","0x18ef40" "QCoreApplicationPrivate::sendPostedEvents","0.04","0","libQt5Core.so.5","QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)","[Unknown]","0x2817e0" "TTextEdit::paintEvent","0.04","0","mudlet","TTextEdit::paintEvent(QPaintEvent*)","TTextEdit.cpp","0x3b22d0" "func@0x2d3b50","0.04","0","libQt5Core.so.5","func@0x2d3b50","[Unknown]","0x2d3b50" "func@0x3108f0","0.0320043","0","libQt5Core.so.5","func@0x3108f0","[Unknown]","0x3108f0" "QXmlStreamWriter::writeAttribute","0.0320043","0","libQt5Core.so.5","QXmlStreamWriter::writeAttribute(QString const&, QString const&)","[Unknown]","0x3115e0" "func@0x2da63d","0.0280065","0","libQt5Core.so.5","func@0x2da63d","[Unknown]","0x2da63d" "func@0x2da260","0.0280065","0.020004","libQt5Core.so.5","func@0x2da260","[Unknown]","0x2da260" "TTextEdit::drawForeground","0.0279944","0","mudlet","TTextEdit::drawForeground(QPainter&, QRect const&)","TTextEdit.cpp","0x3b1260" "__GI_","0.0200256","0.0200256","libc.so.6","float __GI_(long, int, bool, char)","malloc.c","0x8f3e0" "QArrayData::allocate","0.0200236","0","libQt5Core.so.5","QArrayData::allocate(unsigned long, unsigned long, unsigned long, QFlags<QArrayData::AllocationOption>)","[Unknown]","0xad750" "QTextEncoder::fromUnicode","0.020004","0","libQt5Core.so.5","QTextEncoder::fromUnicode(QString const&)","[Unknown]","0x2d8a70" "func@0x33fd20","0.02","0","libQt5Gui.so.5","func@0x33fd20","[Unknown]","0x33fd20" "func@0x341f90","0.02","0","libQt5Gui.so.5","func@0x341f90","[Unknown]","0x341f90" "QRasterPlatformPixmap::fill","0.0149011","0","libQt5Gui.so.5","QRasterPlatformPixmap::fill(QColor const&)","[Unknown]","0x1aaa30" "QPixmap::fill","0.0149011","0","libQt5Gui.so.5","QPixmap::fill(QColor const&)","[Unknown]","0x1a1d40" "func@0x4756d0","0.0149011","0.0149011","libQt5Gui.so.5","func@0x4756d0","[Unknown]","0x4756d0" "QString::fromAscii_helper","0.0120211","0","libQt5Core.so.5","QString::fromAscii_helper(char const*, int)","[Unknown]","0x124de0" "QString::QString","0.0120211","0","mudlet","QString::QString(char const*)","qstring.h","0x82960" "__GI___libc_malloc","0.0120211","0.0120211","libc.so.6","__GI___libc_malloc","malloc.c","0x8eeb0" "QString::fromUtf8_helper","0.0120211","0","libQt5Core.so.5","QString::fromUtf8_helper(char const*, int)","[Unknown]","0x124db0" "QString::QString","0.0120211","0","libQt5Core.so.5","QString::QString(int, Qt::Initialization)","[Unknown]","0x11fee0" "func@0x2da960","0.0120211","0","libQt5Core.so.5","func@0x2da960","[Unknown]","0x2da960" "QString::~QString","0.0120206","0","mudlet","QString::~QString(void)","atomic_base.h","0x73920" "QtPrivate::RefCount::deref","0.0120206","0.0120206","mudlet","QtPrivate::RefCount::deref(void)","qrefcount.h","0x73920" "func@0xfa7b0","0.0120056","0.0120056","libQt5Gui.so.5","func@0xfa7b0","[Unknown]","0xfa7b0" "QRasterPaintEngine::fillRect","0.0120056","0","libQt5Gui.so.5","QRasterPaintEngine::fillRect(QRectF const&, QSpanData*)","[Unknown]","0x342fe0" "TTextEdit::drawBackground","0.0120056","0","mudlet","TTextEdit::drawBackground(QPainter&, QRect const&, QColor const&)","TTextEdit.cpp","0x3ab180" "QPainter::fillRect","0.0120056","0","mudlet","QPainter::fillRect(int, int, int, int, QColor const&)","qpainter.h","0x3ab1a1" "QPainter::fillRect","0.0120056","0","libQt5Gui.so.5","QPainter::fillRect(QRect const&, QColor const&)","[Unknown]","0x3613f0" "func@0xac4d0","0.01","0","libQt5Core.so.5","func@0xac4d0","[Unknown]","0xac4d0" "func@0x16690","0.01","0","libQt5DBus.so.5","func@0x16690","[Unknown]","0x16690" "clone","0.01","0","libc.so.6","clone","clone.S","0x114b20" "start_thread","0.01","0","libpthread.so.0","start_thread","pthread_create.c","0x7720" "QThread::exec","0.01","0","libQt5Core.so.5","QThread::exec(void)","[Unknown]","0xa7660" "qCalculateBlockSize","0.00800247","0.00800247","libQt5Core.so.5","qCalculateBlockSize(unsigned long, unsigned long, unsigned long)","[Unknown]","0xaf680" "QByteArray::QByteArray","0.00800247","0","libQt5Core.so.5","QByteArray::QByteArray(int, Qt::Initialization)","[Unknown]","0xb0050" "QTextEncoder::fromUnicode","0.00800247","0","libQt5Core.so.5","QTextEncoder::fromUnicode(QChar const*, int)","[Unknown]","0x2d8ad0" "XMLexport::writeAlias","0.00799641","0","mudlet","XMLexport::writeAlias(TAlias*)","XMLexport.cpp","0x3c6940" "QPainter::drawPixmap","0.00799437","0","mudlet","QPainter::drawPixmap(int, int, QPixmap const&)","qpainter.h","0x3b1b09" "QPainter::drawPixmap","0.00799437","0","libQt5Gui.so.5","QPainter::drawPixmap(QPointF const&, QPixmap const&)","[Unknown]","0x364160" "QRasterPaintEngine::drawImage","0.00799437","0","libQt5Gui.so.5","QRasterPaintEngine::drawImage(QPointF const&, QImage const&)","[Unknown]","0x348670" "func@0xe5860","0.00799437","0","libQt5Gui.so.5","func@0xe5860","[Unknown]","0xe5860" "__memcpy_sse2_unaligned_erms","0.00799437","0.00799437","libc.so.6","__memcpy_sse2_unaligned_erms","memmove-vec-unaligned-erms.S","0xb2350" "QRasterPaintEngine::drawPixmap","0.00799437","0","libQt5Gui.so.5","QRasterPaintEngine::drawPixmap(QPointF const&, QPixmap const&)","[Unknown]","0x34ba10" "__GI_","0.00799389","0.00799389","libc.so.6","long double __GI_(long, int, bool, char)","malloc.c","0x8fa00" "QArrayData::reallocateUnaligned","0.00799389","0","libQt5Core.so.5","QArrayData::reallocateUnaligned(QArrayData*, unsigned long, unsigned long, QFlags<QArrayData::AllocationOption>)","[Unknown]","0xad850" "QString::reallocData","0.00799389","0","libQt5Core.so.5","QString::reallocData(unsigned int, bool)","[Unknown]","0x120660" "func@0x310cd0","0.00799389","0","libQt5Core.so.5","func@0x310cd0","[Unknown]","0x310cd0" "XMLexport::writeScriptElement","0.00799389","0","mudlet","XMLexport::writeScriptElement(QString const&)","XMLexport.cpp","0x3c6240" "QIODevice::pos","0.00798323","0.00798323","libQt5Core.so.5","QIODevice::pos(void) const","[Unknown]","0x1aaaf0" "memcpy","0.00798323","0.00798323","libc.so.6","memcpy","memmove-vec-unaligned-erms.S","0xb2290" "func@0x311100","0.00797647","0.00797647","libQt5Core.so.5","func@0x311100","[Unknown]","0x311100" "QTextEngine::shapeText","0.00509891","0","libQt5Gui.so.5","QTextEngine::shapeText(int) const","[Unknown]","0x203a60" "QPainter::drawText","0.00509891","0","libQt5Gui.so.5","QPainter::drawText(QPointF const&, QString const&, int, int)","[Unknown]","0x368740" "QTextEngine::shapeLine","0.00509891","0","libQt5Gui.so.5","QTextEngine::shapeLine(QScriptLine const&)","[Unknown]","0x20a7f0" "QTextEngine::shape","0.00509891","0","libQt5Gui.so.5","QTextEngine::shape(int) const","[Unknown]","0x204950" "QTextEngine::shapeTextWithHarfbuzzNG","0.00509891","0","libQt5Gui.so.5","QTextEngine::shapeTextWithHarfbuzzNG(QScriptItem const&, unsigned short const*, int, QFontEngine*, QVector<unsigned int> const&, bool, bool) const","[Unknown]","0x200da0" "func@0x4a8350","0.00509891","0","libQt5Gui.so.5","func@0x4a8350","[Unknown]","0x4a8350" "func@0x4a8a90","0.00509891","0","libQt5Gui.so.5","func@0x4a8a90","[Unknown]","0x4a8a90" "func@0x4c4360","0.00509891","0","libQt5Gui.so.5","func@0x4c4360","[Unknown]","0x4c4360" "func@0x4af210","0.00509891","0.00509891","libQt5Gui.so.5","func@0x4af210","[Unknown]","0x4af210" "TTextEdit::drawCharacters","0.00509891","0","mudlet","TTextEdit::drawCharacters(QPainter&, QRect const&, QString&, bool, bool, bool, bool, QColor&, QColor&)","TTextEdit.cpp","0x3b3d30"
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest