bruns created this revision. bruns added reviewers: Baloo, Frameworks, ngraham, astippich, poboiko. Herald added projects: Frameworks, Baloo. Herald added a subscriber: kde-frameworks-devel. bruns requested review of this revision.
REVISION SUMMARY Both getVarint32Ptr and getVarint32PtrFallback return nullptr when p >= limit. Avoid the call to getVarint32PtrFallback and immediately return from getVarint32. As it is safe to call getVarint32 with p >= limit, skip the extra check in each getDifferentialVarInt32 loop iteration, speeds up decoding results for the 3 benchmark cases by ~10%. Remove unnecessary reinterpret_cast<char*>(p), p is a char*. TEST PLAN positioncodecbenchmark ctest REPOSITORY R293 Baloo BRANCH submit REVISION DETAIL https://phabricator.kde.org/D17332 AFFECTED FILES src/codecs/coding.cpp src/codecs/coding.h To: bruns, #baloo, #frameworks, ngraham, astippich, poboiko Cc: kde-frameworks-devel, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams