Diffusion Krita 535cb0e5f610

Speedup KisConvolutionWorkerFFT: avoid QVector detaching, use iterators

Authored by kossebau on May 30 2016, 9:25 AM.

Description

Speedup KisConvolutionWorkerFFT: avoid QVector detaching, use iterators

Summary:
Iterators for speed up for the usual reasons compared to explicit data access by [].

Due to the implicit sharing logic of QVector the old code resulted
in creation of new memory objects on each loop run:

QVector d;
for-loop
  QVector c(d); // implicit sharing of data
  modify-d(); // copy-on-write -> new memory object allocated for d

This has been changed to

QVector d;
QVector c;
for-loop
  copy-data-from-c-to-d;
  modify-d(); // nothing shared, no new memory object

Reviewers: dkazakov, rempt, Krita:_next

Reviewed By: rempt, Krita:_next

Differential Revision: https://phabricator.kde.org/D1712

Details