Reduce the amount of allocations by not resizing the 'head' bytearray
after extracting each header.
Details
Details
- Reviewers
vkrause - Commits
- R180:bd3bc77edbe4: Optimize parsing headers
Diff Detail
Diff Detail
- Repository
- R180 PIM: KMime
- Branch
- master
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Comment Actions
Do we have autotest for it, as it's a big changes.
not sure that we can create some autotests for it.
Comment Actions
All the existing unit-tests pass, and since this code is executed whenever KMime::Content::parse() is called it would show up in most of the tests.
Comment Actions
LGTM. A possible further optimization might be trying to avoid the QByteArray::fromRawString calls, as they also allocate (the dptr of the QByteArray, not the actual data).
Comment Actions
@vkrause The only way I see is to change the relevant APIs to have a const char* + size_t overload - is that what you meant?
Comment Actions
Yep, exactly. QByteArrayView would address this too, but that's still a long way out.