Improved deserializeMsgPack() speed by reading several bytes at once

This commit is contained in:
Benoit Blanchon
2019-10-14 12:02:26 +02:00
parent fd8f4eb3a6
commit 16fe3c0acc
11 changed files with 286 additions and 50 deletions

View File

@@ -142,10 +142,7 @@ class MsgPackDeserializer {
}
bool readBytes(uint8_t *p, size_t n) {
for (size_t i = 0; i < n; i++) {
if (!readByte(p[i])) return false;
}
return true;
return _reader.readBytes(reinterpret_cast<char *>(p), n) == n;
}
template <typename T>