[Development] API review request: CBOR Stream reader and writer
Thiago Macieira
thiago.macieira at intel.com
Tue Jan 23 01:56:56 CET 2018
On segunda-feira, 22 de janeiro de 2018 01:37:40 PST Thiago Macieira wrote:
> Binary JSON validating:
> 97,003559 task-clock:u (msec)
> 237.092.857 cycles
> 437.005.872 instructions
> [15.2% was spent in QIODevice::readAll, 59.1% in fromBinaryData]
>
> JSON parsing:
> 273,359723 task-clock:u (msec)
> 793.297.513 cycles
> 2.698.607.303 instructions
> [4.7% in readAll(), 78.2% in fromJson]
>
> CBOR parsing:
> 341,311535 task-clock
> 885.053.081 cycles
> 2.548.803.851 instructions
After fixing the converter example to properly use mmap in all three cases,
plus refactoring the CBOR parser to operate on a pre-loaded array and use
larger buffer than single-digit byte counts, the numbers are:
Binary JSON:
69,844846 task-clock:u (msec)
196.906.259 cycles:u
422.255.714 instructions:u
[There's no readAll(); 70.2% of the time is spent inside
QJsonPrivate::Object::isValid]
JSON:
255,809132 task-clock:u (msec)
771.771.000 cycles:u
2.690.966.058 instructions:u
[80.2% inside QJsonPrivate::Parser::parseValue, 58.7% inside
QJsonPrivate::Parser::parseString and 16.3% inside QUtf8Functions::fromUtf8]
CBOR:
239,059121 task-clock:u (msec)
562.474.857 cycles:u
1.431.590.428 instructions:u
[71.6% inside QCborValue::fromCbor, 65.0% inside
QCborContainerPrivate::decodeStringFromCbor, 25.5% inside
QCborStreamReader::readStringChunk plus 12.6% inside QUtf8::isValidUtf8]
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Development
mailing list