D15426: Avoid QByteArray::remove in AccessManagerReply::readData

Stefan BrĂ¼ns noreply at phabricator.kde.org
Tue Sep 11 21:23:20 BST 2018


bruns added a comment.


  For the trivial case, do the clear in `readData()`.
  
  For the non-trivial case:
  
  1. in `readData()`, no memmoves were ever done. Currently, if you have e.g. 50 kB in m_data, you read 2 * 16 kB, and move the remaining 18 kB to the front. You can instead just read 3 * 16 + 2 kB.
  2. in `slotData()`, you have to do a copy every time `capacity()` is exceeded. You can piggy-pack on this necessary copy/move, and either do a move if `m_offset >= data.size()` else do a copy of the old data, last append the new `data`.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D15426

To: fvogt, #frameworks, elvisangelaccio
Cc: bruns, kde-frameworks-devel, michaelh, ngraham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180911/56f91a27/attachment.html>


More information about the Kde-frameworks-devel mailing list