Commit cde908f0 authored by EXT Arnaud Clère's avatar EXT Arnaud Clère

Improved QJsonWriter perf x2 by supporting QByteArray in addition to

QIODevice
Added PersonsView as a simple technique to customize existing bind
parent 27c8cf46
......@@ -156,10 +156,18 @@ private:
class QJsonWriter : public IWriter
{
Q_DISABLE_COPY(QJsonWriter)
Q_ENABLE_MOVE(QJsonWriter, std::swap(io, o.io); std::swap(ba, o.ba); std::swap(levels, o.levels); )
public:
<<<<<<< HEAD
QJsonWriter(QIODevice* io) : io(io) { Q_ASSERT(io); }
~QJsonWriter() { for (auto&& level : levels) io->write(level.end); }
void reset(QIODevice* io) { this->io=io; Q_ASSERT(io); levels.resize(0); }
=======
QJsonWriter( QIODevice* io) : io(io) { Q_ASSERT(io || ba); }
QJsonWriter(QByteArray* ba) : ba(ba) { Q_ASSERT(io || ba); }
~QJsonWriter() { while (!levels.isEmpty()) write(levels.takeLast().end); }
// void reset(QIODevice* io) { this->io=io; Q_ASSERT(io); levels.resize(0); }
>>>>>>> Improved QJsonWriter perf x2 by supporting QByteArray in addition to
// Shortcuts
/**/ Val<Cursor> value ( ) { return Cursor(this).value(); }
......@@ -168,6 +176,7 @@ public:
protected:
template<class T> friend class QModelWriter;
<<<<<<< HEAD
bool _sequence(quint32* s=nullptr) { Q_UNUSED(s); levels.push(Step{"","]"}); return io->write("["); }
bool _record (quint32* s=nullptr) { Q_UNUSED(s); levels.push(Step{"","}"}); return io->write("{"); }
bool _null ( ) { return io->write( "null" ); }
......@@ -208,14 +217,64 @@ private:
io->putChar( '0' );
io->putChar(high+(high<10?'0':'A'-10));
io->putChar( low+( low<10?'0':'A'-10)); } break;
=======
bool _sequence(quint32* s=nullptr) { Q_UNUSED(s); levels.push(Step{"","]"}); return putChar('['); }
bool _record (quint32* s=nullptr) { Q_UNUSED(s); levels.push(Step{"","}"}); return putChar('{'); }
bool _null ( ) { return write("null"); }
bool _bind ( QUtf8DataView u) { return putString(u.data(), u.size()); }
// JSON literals
bool _bind ( bool&& n) { return write( n?"true":"false" ); }
bool _bind ( float&& n) { return write(QByteArray::number(n,'g',std::numeric_limits< float>::max_digits10)); }
bool _bind ( double&& n) { return write(QByteArray::number(n,'g',std::numeric_limits<double>::max_digits10)); }
bool _bind ( quint64&& t) { return write(QByteArray::number(t)); }
bool _bind ( qint64&& t) { return write(QByteArray::number(t)); }
bool _item(QIdentifier& n) { auto r=(write(levels.last().sep) || *levels.last().sep=='\0') && putString(n.data(), n.size()) && putChar(':'); levels.last().sep = ","; return r; }
bool _item(QIdentifierLiteral n) { auto r=(write(levels.last().sep) || *levels.last().sep=='\0') && putString(n.data(), n.size()) && putChar(':'); levels.last().sep = ","; return r; }
bool _item( ) { auto r=(write(levels.last().sep) || *levels.last().sep=='\0') ; levels.last().sep = ","; return r; }
bool _out ( ) { return write(levels.pop() .end); }
private:
struct Step { const char* sep; const char* end; };
bool write (const char* utf8) { if (ba) { ba->append( utf8); return true; } else return io->write ( utf8); }
bool putChar ( char ascii) { if (ba) { ba->append(ascii); return true; } else return io->putChar(ascii); }
bool putString(const char* utf8, int size)
{
putChar('"');
for (int i=0 ; i<size ; ++i)
{
/**/ if (utf8[i] == '\\') { putChar('\\'); putChar('\\'); }
else if (utf8[i] == '"') { putChar('\\'); putChar( '"'); }
else if (utf8[i] < 0|| // UTF-8 sequence bytes
utf8[i] >= ' ') { putChar(utf8[i]); }
else {
putChar('\\'); switch (utf8[i]) {
case '\t' : putChar( 't'); break;
case '\b' : putChar( 'b'); break;
case '\f' : putChar( 'f'); break;
case '\n' : putChar( 'n'); break;
case '\r' : putChar( 'r'); break;
default : putChar( 'u'); {
char high=((utf8[i]) / 16), low=((utf8[i]) % 16);
putChar( '0' );
putChar( '0' );
putChar(high+(high<10?'0':'A'-10));
putChar( low+( low<10?'0':'A'-10)); } break;
>>>>>>> Improved QJsonWriter perf x2 by supporting QByteArray in addition to
}
}
}
return io->putChar('"');
return putChar('"');
}
<<<<<<< HEAD
QIODevice* io;
QStack<Step> levels = QStack<Step>(); // TODO Replace with std::vector<bool> for performance //!< minimal dynamic context to implement out() and ensure well-formedness in case Cursor is abandoned
=======
QIODevice* io = nullptr;
QByteArray* ba = nullptr;
QStack<Step> levels = QStack<Step>(); // std::vector<bool> does not increase performance here
>>>>>>> Improved QJsonWriter perf x2 by supporting QByteArray in addition to
};
// --------------------------------------------------------------------------
......
......@@ -96,22 +96,22 @@ protected:
}
}
else {
w._meta(n, meta);
itemWriter()->_meta(n, meta);
}
}
bool _null( ) { return hidden() ? true : I<=d ? w._null() : m->setData(current(), QVariant()); }
bool _null( ) { return hidden() ? true : I<=d ? itemWriter()->_null() : m->setData(current(), QVariant()); }
bool _bind(QUtf8DataView u) { return hidden() ? true : I<=d ?
w._bind(std::move(u)) :
itemWriter()->_bind(std::move(u)) :
m->setData(current(), QString::fromUtf8(u.data(), u.size())); }
bool _bind( bool&& b) { return hidden() ? true : I<=d ? w._bind(std::move(b)) : m->setData(current(), b); }
bool _bind( float&& f) { return hidden() ? true : I<=d ? w._bind(std::move(f)) : m->setData(current(), f); }
bool _bind( double&& f) { return hidden() ? true : I<=d ? w._bind(std::move(f)) : m->setData(current(), f); }
bool _bind( quint64&& i) { return hidden() ? true : I<=d ? w._bind(std::move(i)) :
bool _bind( bool&& b) { return hidden() ? true : I<=d ? itemWriter()->_bind(std::move(b)) : m->setData(current(), b); }
bool _bind( float&& f) { return hidden() ? true : I<=d ? itemWriter()->_bind(std::move(f)) : m->setData(current(), f); }
bool _bind( double&& f) { return hidden() ? true : I<=d ? itemWriter()->_bind(std::move(f)) : m->setData(current(), f); }
bool _bind( quint64&& i) { return hidden() ? true : I<=d ? itemWriter()->_bind(std::move(i)) :
i<=quint64(std::numeric_limits<unsigned int>::max()) ? m->setData(current(), static_cast<unsigned int>(i)) // with QSpinBox delegate
: m->setData(current(), i ); }
bool _bind( qint64&& i) { return hidden() ? true : I<=d ? w._bind(std::move( i)) :
bool _bind( qint64&& i) { return hidden() ? true : I<=d ? itemWriter()->_bind(std::move( i)) :
i<= qint64(std::numeric_limits< int>::max()) ? m->setData(current(), static_cast< int>(i)) // with QSpinBox delegate
: m->setData(current(), i ); }
bool _bind( QVariant&& t) { return hidden() ? true : I<=d ? static_cast<IWriter*>(&w)->_bind(QVariant(t)) : m->setData(current(), t); }
......@@ -119,19 +119,19 @@ protected:
// TODO QPixmap if metadata suggests a QMimeData image ?
bool _out ( ) { if (d--==I) {
return hidden() || (w._out() && _bind(QUtf8DataView(io.buffer())));
return hidden() || (itemWriter()->_out() && _bind(QUtf8DataView(io)));
}
if (d==T && parent.isValid()) {
row=parent.row(); parent=parent.parent(); d=C; // even if hidden()
}
return d<I || hidden() ? true : w._out();
return d<I || hidden() ? true : itemWriter()->_out();
}
bool _sequence(quint32* s=nullptr) { ++d;
if (hidden()) {
return true;
}
if (d==I) {
io.buffer().resize(0); io.open(QIODevice::WriteOnly); w.reset(&io);
io.clear(); w = std::move(TItemWriter(&io));
}
if (is(R)) {
row=-1; // set to 0 by mandatory _item() following
......@@ -139,14 +139,14 @@ protected:
if (is(C)) {
col=-1; // set to 0 by mandatory _item() following
}
return d<I ? true : w._sequence(s);
return d<I ? true : itemWriter()->_sequence(s);
}
bool _record (quint32* s=nullptr) { ++d;
if (hidden()) {
return true;
}
if (d==I) {
io.buffer().resize(0); io.open(QIODevice::WriteOnly); w.reset(&io);
io.clear(); w = std::move(TItemWriter(&io));
}
if (is(R)) {
row=-1; // set to 0 by mandatory _item() following
......@@ -154,7 +154,7 @@ protected:
if (is(C)) {
col=-1; // set to 0 by mandatory _item() following
}
return d<I ? true : w._record (s); }
return d<I ? true : itemWriter()->_record (s); }
bool _item ( ) { Q_ASSERT(d!=T);
if (is(C)) { col++; // mandatory after _sequence()
......@@ -185,7 +185,7 @@ protected:
}
return true;
}
return hidden() || w._item();
return hidden() || itemWriter()->_item();
}
bool _item ( QIdentifier& n) { Q_ASSERT(d!=T);
if (is(R)) { row++; // mandatory after _record()
......@@ -228,7 +228,7 @@ protected:
d=T; parent=m->index(row,0,parent); row=col=0;
return true;
}
return w._item(n);
return itemWriter()->_item(n);
}
private:
......@@ -264,10 +264,11 @@ private:
dimension<sizes.size() ? sizes.at(dimension)
: 0;
}
IBind* itemWriter() { return static_cast<IBind*>(&w); }
QAbstractItemModel* m;
bool rowFirst;
QBuffer io;
QByteArray io;
TItemWriter w;
// Current bind state
......
......@@ -129,15 +129,17 @@ QDataStream &operator>>(QDataStream &in, Person &p)
return in >> p.firstName >> p.lastName >> p.height >> p.age >> p.phones >> p.comments >> p.children;
}
// Using inheritance to complement an existing bind with meta()
// Using View types to customize an existing bind using metadata
struct PersonsView
{
QList<Person>& persons;
struct Persons : public QVector<Person> {
Cursor bind(Val<Cursor>&& value) {
return value
.meta(qmChildren,"children" )
.meta(qmColumns ,"names,height,age,phones,comments") // to optimize multi-dimensional data formats
.bind(static_cast<QVector<Person>>(*this))
;
.meta(qmChildren,"children")
.meta(qmColumns ,"names,height,age,phones,comments") // to optimize multi-dimensional data formats
.bind(persons);
}
};
......@@ -191,6 +193,7 @@ struct QBind<QColor> {
class TextWriter : public IWriter
{
Q_DISABLE_COPY(TextWriter)
Q_ENABLE_MOVE_DEFAULT(TextWriter)
public:
TextWriter(QByteArray* utf8) : utf8(utf8) { Q_ASSERT(utf8); }
......@@ -211,6 +214,7 @@ protected:
void _meta(QIdentifierLiteral& n, QAsciiData& m) { if (n==qmName) utf8->append('(').append(m.utf8()).append(")"); }
private:
template<class T> friend class QModelWriter;
QByteArray* utf8;
};
......@@ -316,8 +320,8 @@ int main(int argc, char *argv[])
}
STOP("Text",b.buffer());
START {
b.seek(0); b.buffer().resize(0);
QJsonWriter(&b).sequence()
ba.resize(0);
QJsonWriter(&ba).sequence()
.bind(1.333333333333f)
.bind(PI)
.bind(ascii)
......@@ -325,7 +329,7 @@ int main(int argc, char *argv[])
.bind(color)
;
}
STOP("Json",b.buffer());
STOP("Json",ba);
START {
ba.resize(0);
QXmlStreamWriter w(&ba);
......@@ -427,10 +431,10 @@ int main(int argc, char *argv[])
}
STOP("Bindables>Cbor",ba.toHex());
START {
b.seek(0); b.buffer().resize(0);
QJsonWriter(&b).bind(bindables);
ba.resize(0);
QJsonWriter(&ba).bind(bindables);
}
STOP("Bindables>Json",b.buffer());
STOP("Bindables>Json",ba);
}
GROUP_STOP;
GROUP("doubles>")//========================================================
......@@ -449,10 +453,10 @@ int main(int argc, char *argv[])
}
STOP("Text",b.buffer());
START {
b.seek(0); b.buffer().resize(0);
QJsonWriter(&b).bind(transform);
ba.resize(0);
QJsonWriter(&ba).bind(transform);
}
STOP("Json",b.buffer())
STOP("Json",ba)
START {
ba.resize(0);
QXmlStreamWriter w(&ba);
......@@ -519,10 +523,10 @@ int main(int argc, char *argv[])
}
STOP("Bindable>Cbor",ba.toHex());
START {
b.seek(0); b.buffer().resize(0);
QJsonWriter(&b).bind(bindable);
ba.resize(0);
QJsonWriter(&ba).bind(bindable);
}
STOP("Bindable>Json",b.buffer());
STOP("Bindable>Json",ba);
}
GROUP_STOP
GROUP("Person>")//=========================================================
......@@ -539,10 +543,10 @@ int main(int argc, char *argv[])
}
STOP("Text",b.buffer());
START {
b.seek(0); b.buffer().resize(0);
QJsonWriter(&b).bind(person);
ba.resize(0);
QJsonWriter(&ba).bind(person);
}
STOP("Json",b.buffer())
STOP("Json",ba)
START {
ba.resize(0);
QXmlStreamWriter w(&ba);
......@@ -645,10 +649,10 @@ int main(int argc, char *argv[])
}
STOP("Bindable>Cbor",ba.toHex());
START {
b.seek(0); b.buffer().resize(0);
QJsonWriter(&b).bind(bindable);
ba.resize(0);
QJsonWriter(&ba).bind(bindable);
}
STOP("Bindable>Json",b.buffer());
STOP("Bindable>Json",ba);
}
GROUP_STOP
GROUP("Phone>")//=========================================================
......@@ -665,10 +669,10 @@ int main(int argc, char *argv[])
}
STOP("Text",b.buffer());
START {
b.seek(0); b.buffer().resize(0);
QJsonWriter(&b).bind(phone);
ba.resize(0);
QJsonWriter(&ba).bind(phone);
}
STOP("Json",b.buffer())
STOP("Json",ba)
START {
ba.resize(0);
QXmlStreamWriter w(&ba);
......@@ -725,10 +729,10 @@ int main(int argc, char *argv[])
}
STOP("Bindable>Cbor",ba.toHex());
START {
b.seek(0); b.buffer().resize(0);
QJsonWriter(&b).bind(bindable);
ba.resize(0);
QJsonWriter(&ba).bind(bindable);
}
STOP("Bindable>Json",b.buffer());
STOP("Bindable>Json",ba);
}
GROUP_STOP
......@@ -1017,7 +1021,7 @@ void doGuiExample() {
persons[1].phones.append(Phone{Phone::Office,"112"});
// Generic data structures to bind with
QStandardItemModel matrixModel, treeModel, tableModel, customModel, flatModel;
QStandardItemModel matrixModel, treeModel, tableModel, viewModel, customModel, flatModel;
// Using meta() to drive various custom bind
QModelWriter<>(&matrixModel,false).value().meta(qmSizes ,"4,3" ).bind(transform);
......@@ -1025,7 +1029,11 @@ void doGuiExample() {
/*.meta(qmColumns ,"names,age")*/.bind(persons);
QModelWriter<>(& tableModel ).value().meta(qmColumns ,"names,age") .bind(persons);
// Various possible designs for flexible custom bind
// Various possibilities to customize bind
// Using view types (non owning const & with a custom bind method)
QModelWriter<TextWriter>(& viewModel).value().bind(PersonsView{persons});
#if 0
// Design that works for Read/Write but requires several cumbersome functions
QModelWriter<>(&customModel).sequence().forEach(persons, [](Person& p, Val<Cursor>&& item)->Cursor {
......@@ -1068,10 +1076,11 @@ void doGuiExample() {
auto layout = new QHBoxLayout(&dlg); dlg.setLayout(layout);
auto split = new QSplitter (&dlg); layout->addWidget(split );
auto matrix = new QTableView(&dlg); split ->addWidget(matrix); matrix->setModel(&matrixModel); matrix->resizeColumnsToContents();
auto tree = new QTreeView (&dlg); split ->addWidget(tree ); tree ->setModel(& treeModel); for(int i=0; i<treeModel.columnCount(); i++) tree ->resizeColumnToContents(i);
auto tree = new QTreeView (&dlg); split ->addWidget(tree ); tree ->setModel(& treeModel); for(int i=0; i<treeModel.columnCount(); i++) tree->resizeColumnToContents(i);
auto table = new QTableView(&dlg); split ->addWidget(table ); table ->setModel(& tableModel); table ->resizeColumnsToContents();
auto flat = new QTableView(&dlg); split ->addWidget(flat ); flat ->setModel(& flatModel); flat ->resizeColumnsToContents();
auto view = new QTreeView (&dlg); split ->addWidget(view ); view ->setModel(& viewModel); for(int i=0; i<viewModel.columnCount(); i++) view->resizeColumnToContents(i);
auto custom = new QTableView(&dlg); split ->addWidget(custom); custom->setModel(&customModel); custom->resizeColumnsToContents();
auto flat = new QTableView(&dlg); split ->addWidget(flat ); flat ->setModel(& flatModel); flat ->resizeColumnsToContents();
dlg.resize(1280,280);
dlg.exec();
}
tests/QBind/qstandardmodel.PNG

16 KB | W: | H:

tests/QBind/qstandardmodel.PNG

28.1 KB | W: | H:

tests/QBind/qstandardmodel.PNG
tests/QBind/qstandardmodel.PNG
tests/QBind/qstandardmodel.PNG
tests/QBind/qstandardmodel.PNG
  • 2-up
  • Swipe
  • Onion skin
============| QDebug| Text| Json| Xml| Variant| Cbor| QCborStream| Data| QDataStream| QByteArray| Bindables|Bindables>Cbor|Bindables>Json|total(usecs)|variation(%)
<<<<<<< HEAD
builtin> | 15.5| 6.8| 16.0| 93.2| 18.1| 2.4| 3.9| 2.6| 1.4| 0.4| 0.3| 2.6| 16.2| 179.4| 19.4
builtin> | 16.2| 21.4| 15.6| 71.0| 16.5| 2.6| 4.7| 4.9| 3.7| 0.4| 0.3| 4.0| 154.6| 315.8| 76.0
builtin> | 15.2| 6.6| 15.3| 67.0| 18.3| 2.6| 4.2| 2.9| 1.4| 0.4| 0.2| 2.5| 15.0| 151.4| 52.1
......@@ -72,3 +73,89 @@ Person<>Settings| 767.7| 2.1| 22.6| 792.5| 14.2
Person<>Settings| 637.0| 2.1| 23.5| 662.7| 16.4
Person<>Settings| 617.2| 2.3| 44.2| 663.7| 0.2
Person<>Settings| 629.1| 2.3| 23.1| 654.5| 1.4
=======
builtin> | 16.3| 5.2| 8.5| 116.2| 17.7| 2.6| 5.3| 3.4| 1.8| 0.4| 0.3| 2.8| 11.2| 191.8| 62.1
builtin> | 14.8| 6.4| 12.1| 80.7| 14.1| 2.1| 3.8| 2.8| 1.6| 0.2| 0.2| 2.3| 10.0| 151.0| 21.3
builtin> | 15.0| 6.1| 12.7| 86.9| 15.2| 2.5| 4.2| 2.4| 1.4| 0.2| 0.1| 2.5| 8.5| 157.9| 4.5
builtin> | 14.7| 6.3| 9.9| 67.3| 13.4| 1.9| 3.4| 2.2| 1.4| 0.3| 0.1| 2.1| 10.6| 133.5| 15.4
builtin> | 16.3| 6.9| 18.2| 78.5| 16.1| 2.5| 8.2| 2.5| 1.2| 0.2| 0.2| 2.8| 11.4| 165.0| 23.6
builtin> | 15.2| 5.8| 9.2| 67.4| 16.1| 3.7| 5.9| 3.7| 1.7| 0.4| 0.3| 3.0| 21.6| 154.1| 6.6
builtin> | 17.1| 9.3| 11.5| 86.2| 15.6| 2.3| 4.4| 2.6| 1.4| 0.3| 0.2| 2.6| 10.2| 163.7| 6.3
builtin> | 16.8| 5.7| 9.8| 83.7| 18.2| 2.8| 4.7| 3.3| 3.2| 0.5| 0.8| 3.6| 12.5| 165.7| 1.3
builtin> | 15.6| 5.5| 9.3| 76.8| 14.2| 2.0| 4.2| 2.6| 1.4| 0.2| 0.2| 2.1| 8.8| 143.0| 13.7
builtin> | 16.3| 8.1| 8.3| 80.6| 14.2| 1.7| 2.5| 1.7| 0.9| 0.3| 0.2| 1.9| 7.0| 143.6| 0.4
builtin> | 8.8| 4.7| 11.7| 58.6| 17.2| 2.2| 3.2| 2.3| 1.0| 0.3| 0.2| 2.0| 7.4| 119.7| 16.7
============| QDebug| Text| Json| Xml| Variant| Cbor| QCborStream| Data| QDataStream| QByteArray| Bindable| Bindable>Cbor| Bindable>Json|total(usecs)|variation(%)
doubles> | 27.5| 14.2| 21.4| 86.5| 12.5| 2.5| 3.0| 2.9| 2.3| 0.9| 0.0| 2.3| 25.7| 201.5| 4.6
doubles> | 17.6| 17.7| 19.6| 86.0| 10.0| 2.4| 2.9| 5.6| 2.5| 0.7| 0.0| 2.5| 19.1| 186.6| 7.4
doubles> | 22.4| 26.7| 21.1| 89.4| 8.4| 2.3| 2.9| 2.8| 2.1| 0.8| 0.0| 2.2| 28.3| 209.6| 12.4
doubles> | 16.9| 14.4| 26.8| 100.2| 11.7| 1.6| 1.9| 2.2| 1.4| 0.7| 0.0| 1.7| 16.9| 196.4| 6.3
doubles> | 26.3| 26.3| 19.0| 95.6| 8.0| 1.6| 2.0| 1.8| 1.3| 0.6| 0.0| 1.5| 21.3| 205.1| 4.4
doubles> | 20.1| 18.6| 15.6| 90.7| 12.2| 2.5| 3.2| 5.3| 1.9| 0.8| 0.0| 2.3| 22.0| 195.3| 4.8
doubles> | 17.3| 24.4| 25.8| 88.9| 12.1| 2.3| 3.0| 3.0| 2.5| 0.9| 0.0| 2.3| 22.3| 204.8| 4.9
doubles> | 17.7| 27.6| 25.1| 80.2| 13.3| 4.5| 2.7| 2.3| 1.7| 0.5| 0.0| 1.0| 25.9| 202.6| 1.1
doubles> | 27.6| 16.5| 22.2| 78.9| 13.2| 2.7| 3.3| 3.1| 2.4| 0.8| 0.0| 2.2| 19.8| 192.8| 4.8
doubles> | 20.2| 24.1| 21.3| 94.2| 12.3| 2.5| 3.2| 2.9| 2.1| 0.8| 0.0| 2.2| 31.6| 217.5| 12.8
doubles> | 24.8| 16.4| 23.1| 88.7| 5.9| 1.0| 1.5| 2.5| 2.3| 0.8| 0.0| 2.2| 28.3| 197.5| 9.2
doubles> | 19.0| 15.2| 23.5| 97.4| 11.7| 1.6| 2.4| 1.9| 1.4| 0.6| 0.0| 1.6| 16.1| 192.7| 2.4
doubles> | 25.5| 22.4| 14.8| 75.0| 10.4| 2.2| 2.7| 3.1| 2.9| 0.9| 0.0| 2.4| 30.2| 192.5| 0.1
doubles> | 21.5| 16.5| 30.8| 86.6| 9.2| 2.2| 2.9| 2.9| 2.2| 0.8| 0.0| 2.3| 28.4| 206.3| 7.2
============| QDebug| Text| Json| Xml| Variant| Cbor| QCborStream| Data| QDataStream| QByteArray| Bindable| Bindable>Cbor| Bindable>Json|total(usecs)|variation(%)
Person> | 12.8| 12.9| 13.3| 31.6| 21.0| 6.6| 7.1| 1.8| 1.0| 0.4| 0.0| 4.4| 14.2| 127.0| 4.3
Person> | 7.3| 10.7| 14.6| 39.0| 20.6| 6.3| 4.6| 1.4| 0.9| 0.4| 0.0| 4.1| 9.8| 119.7| 5.7
Person> | 10.8| 11.7| 15.1| 34.1| 15.7| 6.0| 6.8| 2.2| 1.6| 0.5| 0.0| 6.5| 15.2| 126.2| 5.4
Person> | 7.4| 12.6| 13.6| 30.2| 19.6| 6.5| 6.7| 2.8| 1.3| 0.4| 0.0| 4.4| 9.9| 115.3| 8.6
Person> | 7.1| 8.2| 15.5| 41.6| 12.9| 4.4| 6.6| 2.1| 1.5| 0.5| 0.0| 6.3| 15.0| 121.7| 5.5
Person> | 10.7| 8.0| 10.3| 44.1| 22.1| 6.6| 5.9| 1.4| 0.9| 0.4| 0.0| 4.5| 10.2| 125.0| 2.7
Person> | 10.4| 12.5| 15.7| 33.7| 14.9| 6.0| 6.8| 2.2| 1.5| 0.5| 0.0| 6.7| 18.8| 129.7| 3.7
Person> | 7.8| 6.1| 6.5| 43.0| 12.8| 3.1| 3.5| 1.3| 0.7| 0.1| 0.0| 3.1| 9.1| 97.1| 25.1
Person> | 10.7| 11.8| 14.9| 36.2| 13.7| 7.1| 8.6| 2.4| 1.7| 0.5| 0.0| 6.4| 13.3| 127.3| 31.1
Person> | 7.1| 7.2| 6.4| 44.3| 14.9| 4.1| 4.2| 1.4| 0.9| 0.4| 0.0| 6.1| 13.4| 110.5| 13.2
Person> | 7.7| 7.6| 11.1| 44.6| 13.4| 4.5| 4.2| 1.4| 0.9| 0.4| 0.0| 4.3| 14.3| 114.4| 3.6
Person> | 12.1| 12.3| 15.6| 46.4| 20.9| 6.5| 7.3| 1.5| 1.2| 0.4| 0.0| 4.1| 10.4| 138.8| 21.3
Person> | 7.3| 12.1| 10.1| 40.4| 21.2| 4.4| 4.2| 1.4| 0.9| 0.4| 0.0| 4.1| 9.8| 116.4| 16.1
Person> | 9.0| 12.6| 14.7| 42.8| 15.3| 3.1| 3.4| 1.0| 0.7| 0.1| 0.0| 3.2| 15.5| 121.3| 4.2
Person> | 9.5| 7.7| 9.8| 45.3| 16.1| 4.1| 4.2| 1.4| 0.9| 0.4| 0.0| 4.1| 12.3| 115.9| 4.5
Person> | 11.9| 12.2| 14.8| 32.2| 19.0| 6.1| 6.8| 2.2| 1.5| 0.5| 0.0| 6.5| 14.0| 127.7| 10.2
Person> | 7.1| 7.7| 9.8| 46.6| 14.6| 4.1| 4.2| 1.5| 0.9| 0.4| 0.0| 5.6| 14.5| 117.1| 8.3
Person> | 12.0| 11.7| 9.8| 35.5| 21.4| 6.3| 4.2| 1.4| 0.9| 0.4| 0.0| 4.1| 9.8| 117.6| 0.5
Person> | 8.2| 11.7| 14.9| 33.7| 16.0| 6.2| 7.0| 1.4| 1.1| 0.4| 0.0| 7.6| 13.8| 122.2| 3.9
============| QDebug| Text| Json| Xml| Variant| Cbor| QCborStream| Data| QDataStream| QByteArray| Bindable| Bindable>Cbor| Bindable>Json|total(usecs)|variation(%)
Phone> | 2.7| 6.3| 7.2| 18.8| 9.8| 8.4| 1.7| 0.8| 0.3| 0.5| 0.0| 5.8| 7.3| 69.8| 2.1
Phone> | 3.8| 9.5| 11.0| 23.7| 6.6| 6.0| 1.6| 0.8| 0.3| 0.5| 0.0| 6.0| 10.2| 80.1| 14.9
Phone> | 5.8| 6.7| 7.1| 26.3| 10.2| 9.6| 2.6| 1.1| 0.7| 1.0| 0.1| 6.7| 7.2| 85.1| 6.2
Phone> | 2.7| 6.2| 7.6| 26.3| 10.1| 8.1| 1.6| 0.8| 0.3| 0.5| 0.0| 6.0| 7.5| 78.1| 8.3
Phone> | 2.7| 8.0| 10.7| 27.3| 10.2| 6.0| 1.7| 0.8| 0.3| 0.5| 0.0| 6.0| 7.1| 81.4| 4.2
Phone> | 2.9| 9.4| 11.0| 25.8| 8.6| 5.9| 4.2| 1.3| 0.6| 0.9| 0.0| 10.0| 9.4| 90.3| 11.0
Phone> | 2.5| 4.3| 4.8| 13.7| 10.0| 9.3| 2.7| 1.2| 0.6| 1.0| 0.0| 9.4| 7.7| 67.2| 25.5
Phone> | 2.4| 4.3| 5.0| 12.8| 14.8| 15.8| 1.7| 0.8| 0.3| 0.5| 0.0| 6.0| 7.2| 71.5| 6.3
Phone> | 2.9| 9.4| 10.9| 24.9| 6.5| 6.0| 1.6| 0.8| 0.3| 0.5| 0.0| 6.0| 9.4| 79.3| 11.0
Phone> | 4.5| 13.5| 6.9| 18.5| 10.4| 9.5| 2.7| 1.2| 0.5| 0.9| 0.0| 8.5| 5.1| 82.4| 3.8
Phone> | 2.4| 4.3| 4.9| 14.4| 9.9| 9.3| 2.7| 1.3| 0.6| 1.0| 0.0| 10.2| 12.3| 73.3| 11.0
Phone> | 4.3| 9.7| 11.3| 19.1| 6.6| 6.0| 1.8| 0.8| 0.3| 0.5| 0.0| 8.8| 11.4| 80.7| 10.1
Phone> | 4.7| 10.0| 11.2| 12.7| 5.0| 9.2| 1.4| 0.5| 0.2| 0.7| 0.0| 9.7| 11.3| 76.6| 5.1
Phone> | 4.9| 10.6| 9.9| 15.6| 6.7| 7.9| 2.9| 1.2| 0.5| 0.8| 0.0| 9.4| 11.4| 81.8| 6.8
Phone> | 4.5| 8.5| 7.6| 16.2| 8.1| 9.3| 2.6| 1.2| 0.5| 0.9| 0.0| 8.9| 10.9| 79.2| 3.1
Phone> | 4.5| 10.0| 10.7| 16.1| 6.5| 6.2| 2.2| 1.2| 0.6| 0.8| 0.0| 9.3| 11.6| 79.7| 0.6
Phone> | 4.9| 10.3| 9.0| 15.7| 6.7| 8.7| 2.6| 1.2| 0.5| 0.8| 0.0| 9.5| 11.3| 81.2| 1.9
============| Json>P| P>Json| Json>P| P>JsonValue| JsonValue>P|Json>JsonValue| Json>Cbor|total(usecs)|variation(%)
Person<>Json| 34.7| 11.4| 30.9| 19.6| 6.3| 53.7| 53.7| 210.2| 23.0
Person<>Json| 26.5| 10.5| 32.7| 30.6| 9.1| 43.4| 44.8| 197.6| 6.0
Person<>Json| 21.9| 7.5| 36.0| 18.2| 6.3| 52.0| 41.3| 183.1| 7.3
Person<>Json| 32.9| 16.0| 27.4| 17.1| 11.1| 25.9| 43.3| 173.7| 5.1
Person<>Json| 19.1| 7.6| 15.7| 28.9| 9.1| 41.9| 42.0| 164.2| 5.5
Person<>Json| 34.4| 16.4| 25.9| 16.9| 8.5| 49.0| 28.5| 179.6| 9.4
Person<>Json| 29.5| 15.1| 26.6| 17.4| 8.3| 49.6| 32.2| 178.6| 0.6
Person<>Json| 37.8| 7.8| 12.4| 16.9| 9.4| 46.6| 42.1| 173.0| 3.2
============| Cbor>P| P>Cbor| Cbor>P| QCborStream>P| P>CborValue| CborValue>P|Cbor>CborValue|CborValue>Cbor| Cbor>Json|total(usecs)|variation(%)
Person<>Cbor| 25.3| 4.2| 22.5| 14.6| 22.3| 6.7| 32.4| 19.2| 20.2| 167.3| 0.3
Person<>Cbor| 29.7| 5.3| 20.5| 9.6| 21.5| 10.3| 33.4| 11.3| 31.8| 173.3| 3.6
============| P>Settings| Settings>P| P>Settings|total(usecs)|variation(%)
Person<>Settings| 715.5| 1.0| 11.4| 727.9| 17.8
Person<>Settings| 696.8| 2.0| 17.1| 715.9| 1.6
Person<>Settings| 670.4| 1.9| 15.1| 687.4| 4.0
Person<>Settings| 681.8| 1.0| 21.7| 704.5| 2.5
Person<>Settings| 704.0| 1.0| 11.6| 716.6| 1.7
Person<>Settings| 701.2| 2.3| 15.8| 719.4| 0.4
Person<>Settings| 685.6| 2.2| 22.8| 710.6| 1.2
>>>>>>> Improved QJsonWriter perf x2 by supporting QByteArray in addition to
============| QDebug| Text| Json| Xml| Variant| Cbor| QCborStream| Data| QDataStream| QByteArray| Bindables|Bindables>Cbor|Bindables>Json|total(usecs)|variation(%)
<<<<<<< HEAD
builtin> | 15.6| 6.6| 144.8| 62.5| 15.9| 1.4| 3.5| 2.5| 1.4| 0.3| 0.2| 1.6| 16.2| 272.3| 42.3
builtin> | 16.0| 9.7| 15.7| 67.2| 14.9| 1.4| 3.6| 2.6| 2.3| 0.3| 0.2| 1.4| 16.1| 151.2| 44.5
builtin> | 15.5| 5.8| 15.3| 63.2| 83.5| 1.4| 3.5| 2.4| 1.4| 0.3| 0.2| 1.6| 15.8| 209.8| 38.7
......@@ -202,3 +203,93 @@ Person<>Settings| 632.9| 2.0| 22.3| 657.2| 3.7
Person<>Settings| 649.6| 2.9| 22.4| 674.9| 2.7
Person<>Settings| 655.5| 2.1| 21.3| 678.9| 0.6
Person<>Settings| 675.3| 1.9| 21.4| 698.6| 2.9
=======
builtin> | 16.3| 5.9| 9.4| 83.2| 18.3| 1.3| 3.3| 2.3| 1.4| 0.3| 0.2| 1.6| 9.2| 152.6| 31.2
builtin> | 15.8| 6.0| 9.3| 65.9| 19.2| 17.0| 3.6| 2.6| 1.4| 0.3| 0.2| 1.6| 9.3| 152.2| 0.3
builtin> | 15.8| 6.6| 9.4| 66.7| 15.1| 1.4| 3.5| 2.5| 1.3| 0.3| 0.2| 1.6| 9.0| 133.3| 12.4
============| QDebug| Text| Json| Xml| Variant| Cbor| QCborStream| Data| QDataStream| QByteArray| Bindable| Bindable>Cbor| Bindable>Json|total(usecs)|variation(%)
doubles> | 38.2| 33.2| 46.7| 132.3| 29.6| 1.6| 4.3| 9.9| 2.0| 0.8| 0.0| 1.7| 52.1| 352.4| 8.3
doubles> | 32.6| 29.9| 57.5| 126.4| 11.3| 12.7| 2.8| 2.6| 2.3| 0.8| 0.0| 1.6| 36.6| 317.1| 10.0
doubles> | 34.3| 30.3| 34.2| 166.0| 10.6| 1.9| 2.9| 2.6| 2.0| 0.9| 0.0| 1.7| 34.4| 321.9| 1.5
doubles> | 38.5| 34.3| 60.8| 170.0| 12.8| 1.7| 2.7| 6.8| 1.9| 1.1| 0.0| 1.6| 35.5| 367.8| 14.3
doubles> | 41.2| 28.7| 36.0| 132.3| 12.1| 1.9| 9.4| 2.8| 2.1| 0.9| 0.0| 1.9| 40.5| 309.9| 15.7
doubles> | 44.2| 51.2| 37.5| 138.1| 12.4| 1.9| 3.0| 2.8| 2.1| 0.9| 0.0| 1.9| 38.5| 334.6| 8.0
doubles> | 65.8| 66.6| 37.4| 135.4| 12.1| 1.9| 3.0| 2.8| 2.6| 1.3| 0.0| 1.9| 37.9| 368.7| 10.2
doubles> | 38.4| 32.7| 38.7| 139.6| 12.6| 1.9| 3.0| 2.7| 2.0| 0.8| 0.0| 1.9| 45.7| 320.0| 13.2
doubles> | 36.9| 47.4| 38.9| 144.5| 12.0| 1.9| 3.0| 3.2| 2.1| 0.9| 0.0| 1.9| 36.6| 329.4| 2.9
doubles> | 35.8| 34.9| 40.9| 167.7| 12.0| 1.9| 3.0| 2.8| 2.2| 0.9| 0.0| 1.8| 41.4| 345.3| 4.8
doubles> | 35.2| 34.9| 38.7| 149.0| 11.6| 1.9| 2.8| 2.7| 2.2| 0.9| 0.0| 2.0| 36.8| 318.6| 7.7
doubles> | 37.0| 36.0| 37.3| 168.0| 12.3| 1.9| 3.0| 34.6| 2.0| 0.8| 0.0| 2.9| 77.2| 413.1| 29.7
doubles> | 37.8| 33.9| 37.5| 223.5| 14.2| 2.2| 50.3| 2.6| 2.0| 1.3| 0.0| 1.8| 42.1| 449.3| 8.8
doubles> | 142.3| 32.1| 53.9| 191.8| 12.3| 1.9| 3.0| 2.8| 2.1| 0.9| 0.0| 1.9| 40.1| 485.2| 8.0
doubles> | 37.1| 73.6| 39.4| 157.1| 12.2| 1.8| 3.0| 2.8| 2.1| 0.9| 0.0| 1.8| 37.1| 369.0| 24.0
doubles> | 37.1| 32.8| 44.9| 154.2| 12.5| 1.7| 2.7| 2.5| 1.9| 0.8| 0.2| 2.1| 37.3| 330.7| 10.4
doubles> | 49.9| 30.5| 38.3| 125.7| 11.5| 1.7| 3.4| 2.6| 6.9| 1.2| 0.0| 1.8| 35.1| 308.6| 6.7
doubles> | 33.8| 30.2| 35.0| 162.6| 11.4| 1.8| 2.8| 2.7| 2.0| 0.9| 0.0| 1.7| 34.9| 319.7| 3.6
doubles> | 33.9| 54.8| 36.3| 135.8| 11.7| 1.8| 2.8| 2.6| 2.0| 0.9| 0.0| 1.7| 37.5| 321.7| 0.6
doubles> | 35.1| 35.0| 39.1| 139.5| 12.8| 2.2| 2.9| 2.6| 2.0| 0.9| 0.0| 1.7| 40.2| 314.0| 2.4
============| QDebug| Text| Json| Xml| Variant| Cbor| QCborStream| Data| QDataStream| QByteArray| Bindable| Bindable>Cbor| Bindable>Json|total(usecs)|variation(%)
Person> | 14.8| 13.7| 14.9| 53.0| 15.8| 5.6| 7.2| 2.0| 1.4| 0.4| 0.0| 5.6| 19.5| 154.0| 0.1
Person> | 16.3| 20.3| 19.5| 55.6| 18.3| 6.2| 8.3| 3.2| 1.5| 0.4| 0.0| 6.2| 27.4| 183.3| 19.1
============| QDebug| Text| Json| Xml| Variant| Cbor| QCborStream| Data| QDataStream| QByteArray| Bindable| Bindable>Cbor| Bindable>Json|total(usecs)|variation(%)
Phone> | 8.5| 12.1| 10.9| 29.1| 10.6| 9.2| 3.1| 1.1| 0.5| 1.0| 0.0| 9.2| 11.9| 107.3| 8.2
Phone> | 5.1| 11.1| 11.3| 28.5| 10.3| 13.7| 3.1| 1.2| 0.5| 1.0| 0.0| 11.7| 13.0| 110.4| 3.0
Phone> | 5.2| 9.8| 12.1| 49.2| 10.6| 9.3| 3.1| 1.1| 0.5| 12.3| 0.0| 20.0| 12.3| 145.7| 31.9
Phone> | 5.3| 11.0| 10.9| 31.8| 10.7| 9.3| 3.2| 1.2| 0.5| 1.0| 0.0| 9.3| 10.8| 104.9| 28.0
Phone> | 5.2| 9.6| 10.7| 31.5| 10.8| 11.4| 3.0| 1.1| 0.5| 1.0| 0.0| 9.2| 10.9| 105.0| 0.1
Phone> | 5.5| 10.1| 11.5| 29.7| 10.5| 9.1| 3.1| 1.1| 0.5| 1.0| 0.0| 9.3| 13.0| 104.4| 0.6
============| Json>P| P>Json| Json>P| P>JsonValue| JsonValue>P|Json>JsonValue| Json>Cbor|total(usecs)|variation(%)
Person<>Json| 50.0| 19.7| 33.4| 27.5| 9.5| 66.8| 51.1| 258.0| 2.8
Person<>Json| 43.9| 17.1| 33.2| 27.9| 8.2| 64.1| 51.1| 245.5| 4.9
Person<>Json| 42.8| 29.6| 32.5| 27.2| 8.2| 60.5| 59.9| 260.8| 6.2
Person<>Json| 46.1| 21.8| 32.2| 28.8| 8.1| 76.4| 52.9| 266.3| 2.1
Person<>Json| 57.6| 21.5| 32.5| 27.5| 8.2| 60.1| 47.0| 254.5| 4.5
Person<>Json| 40.0| 17.1| 31.8| 27.5| 7.6| 56.6| 52.4| 233.1| 8.4
Person<>Json| 44.3| 17.1| 30.3| 28.6| 8.1| 57.6| 51.6| 237.6| 2.0
Person<>Json| 52.7| 20.9| 34.7| 28.1| 8.8| 62.1| 51.0| 258.2| 8.7
Person<>Json| 65.5| 18.5| 32.4| 26.0| 7.6| 85.0| 51.2| 286.2| 10.8
Person<>Json| 44.2| 31.5| 34.5| 26.5| 11.5| 62.4| 47.7| 258.4| 9.7
Person<>Json| 42.3| 19.4| 104.4| 34.2| 9.0| 56.4| 47.1| 312.9| 21.1
Person<>Json| 44.2| 19.3| 30.8| 64.6| 9.1| 57.7| 45.4| 271.1| 13.4
Person<>Json| 37.6| 18.4| 31.7| 28.2| 6.9| 59.4| 47.5| 229.7| 15.3
Person<>Json| 43.6| 17.7| 30.0| 25.0| 7.2| 54.5| 39.7| 217.6| 5.3
Person<>Json| 40.4| 16.1| 45.9| 26.7| 7.2| 61.7| 47.7| 245.7| 12.9
Person<>Json| 40.4| 15.9| 28.7| 29.1| 7.1| 54.3| 44.6| 220.1| 10.4
Person<>Json| 40.5| 16.6| 30.2| 24.0| 8.0| 95.6| 46.4| 261.2| 18.7
Person<>Json| 40.8| 16.9| 29.9| 27.4| 7.2| 57.1| 45.1| 224.5| 14.0
Person<>Json| 35.3| 16.2| 30.7| 25.1| 6.7| 76.8| 46.7| 237.5| 5.8
Person<>Json| 39.7| 17.7| 30.2| 25.7| 7.8| 53.9| 46.1| 221.1| 6.9
Person<>Json| 38.8| 35.9| 32.5| 24.0| 6.8| 55.7| 45.6| 239.3| 8.2
Person<>Json| 38.8| 16.3| 30.3| 28.4| 7.6| 54.4| 45.6| 221.3| 7.5
Person<>Json| 37.2| 15.6| 28.7| 24.2| 7.2| 58.1| 45.1| 215.9| 2.5
Person<>Json| 39.2| 15.4| 31.0| 23.5| 7.2| 56.1| 46.0| 218.4| 1.1
Person<>Json| 36.0| 17.4| 35.8| 25.9| 7.6| 54.0| 43.9| 220.7| 1.1
Person<>Json| 36.5| 16.2| 30.1| 23.3| 7.2| 49.8| 43.9| 207.0| 6.2
Person<>Json| 35.1| 20.7| 28.4| 22.2| 7.3| 53.7| 43.4| 210.7| 1.8
Person<>Json| 36.9| 16.2| 27.6| 25.4| 7.2| 50.6| 41.8| 205.7| 2.4
Person<>Json| 35.0| 18.1| 32.2| 23.9| 7.9| 46.9| 44.3| 208.3| 1.3
Person<>Json| 37.5| 21.3| 30.0| 22.5| 6.8| 56.7| 50.3| 225.1| 8.1
Person<>Json| 41.5| 17.7| 33.1| 29.3| 7.9| 56.0| 48.0| 233.5| 3.7
Person<>Json| 40.8| 17.3| 30.2| 26.2| 8.8| 52.3| 50.4| 226.0| 3.2
Person<>Json| 38.8| 17.3| 33.3| 26.0| 6.8| 60.2| 48.7| 231.1| 2.3
Person<>Json| 37.8| 17.2| 31.4| 28.0| 10.2| 55.9| 46.3| 226.7| 1.9
Person<>Json| 39.2| 16.1| 28.1| 21.3| 8.3| 58.3| 50.0| 221.3| 2.4
Person<>Json| 54.4| 17.1| 30.5| 27.2| 7.8| 55.8| 47.3| 240.0| 8.5
Person<>Json| 39.8| 10.6| 29.9| 25.1| 7.6| 50.2| 41.1| 204.3| 14.9
Person<>Json| 34.7| 10.3| 18.7| 24.6| 7.6| 23.3| 18.8| 138.1| 32.4
Person<>Json| 32.4| 8.7| 30.1| 23.9| 7.2| 53.4| 46.8| 202.6| 46.7
Person<>Json| 37.5| 16.9| 29.7| 23.5| 7.2| 54.4| 44.6| 213.7| 5.5
Person<>Json| 34.6| 16.4| 29.4| 24.4| 7.2| 53.6| 47.4| 213.0| 0.3
Person<>Json| 33.4| 16.0| 36.3| 25.6| 7.2| 52.6| 41.8| 212.8| 0.1
============| Cbor>P| P>Cbor| Cbor>P| QCborStream>P| P>CborValue| CborValue>P|Cbor>CborValue|CborValue>Cbor| Cbor>Json|total(usecs)|variation(%)
Person<>Cbor| 22.9| 2.7| 22.9| 12.8| 20.0| 6.6| 41.3| 13.6| 33.1| 176.0| 7.8
Person<>Cbor| 29.5| 5.7| 31.6| 13.7| 20.0| 6.5| 41.5| 12.8| 17.9| 179.1| 1.8
Person<>Cbor| 16.4| 5.3| 31.0| 12.5| 18.7| 6.3| 29.7| 8.2| 20.6| 148.7| 17.0
Person<>Cbor| 14.4| 2.7| 17.2| 6.2| 10.1| 3.4| 21.9| 7.1| 15.5| 98.5| 33.7
Person<>Cbor| 15.1| 2.8| 15.4| 6.2| 10.3| 4.1| 22.6| 7.0| 15.2| 98.6| 0.1
Person<>Cbor| 15.0| 2.7| 15.2| 6.4| 12.1| 3.6| 19.6| 7.0| 16.9| 98.6| 0.0
============| P>Settings| Settings>P| P>Settings|total(usecs)|variation(%)
Person<>Settings| 709.4| 2.3| 21.4| 733.1| 4.1
Person<>Settings| 716.4| 2.2| 21.0| 739.6| 0.9
Person<>Settings| 727.2| 2.2| 21.1| 750.5| 1.5
>>>>>>> Improved QJsonWriter perf x2 by supporting QByteArray in addition to