Web lists-archives.com

Re: Review Request 129186: [baloo] Speedup Positioncodec::encode()




This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/129186/

On November 6th, 2016, 7:36 p.m. UTC, David Faure wrote:

src/codecs/coding.cpp (Diff revision 2)
142
    for (int i = 1; i < values.size(); i++) {
160
    for ( auto it = values.cbegin(); it != itEnd; ++it) {

remove space before auto; make it "const auto" while at it?

ignore the const bit, that was nonsense.


- David


On November 6th, 2016, 12:58 p.m. UTC, Christian Ehrlicher wrote:

Review request for Baloo, KDE Frameworks and Vishesh Handa.
By Christian Ehrlicher.

Updated Nov. 6, 2016, 12:58 p.m.

Repository: baloo

Description

This patch speeds up PostingCodec::encode() by a factor of ~4 by not adding every single encoded int32 to the resulting bytearray which results in a lot of small memcpy operations. The idea is to use a preallocated QByteArray and directly encode the integers into this buffer. This makes the code a little bit more complex but the speedup should be gain enough for this.

Ping! No interest in this patch? Should I discard it?

Testing

positoncodectest calculates the same md5sum as before.

Diffs

  • src/codecs/coding.cpp (5961077)

View Diff