D15804: Fix Duplicates on Quick Open File

Tomaz Canabrava noreply at phabricator.kde.org
Fri Sep 28 12:57:52 BST 2018


tcanabrava added a comment.


  In D15804#333199 <https://phabricator.kde.org/D15804#333199>, @tcanabrava wrote:
  
  > In D15804#333171 <https://phabricator.kde.org/D15804#333171>, @cullmann wrote:
  >
  > > Could you do some perf profile with e.g. hotspot to see what is the "slow" part?
  > >  Nothing against std::vector instead of QVector, we need no sharing here anyways.
  >
  >
  > I did. the slow part was copying the QStrings into the allDocuments.
  >  I tried to use QStringRef but since the QStringifycation comes from the QUrl::toString() I didn't managed to get a ref of it.
  
  
  This is the slow hotspot.
  
    foreach(const QString& file, projectDocs) {
          QFileInfo fi(file);
          allDocuments.push_back({ fi.fileName(), QUrl::fromLocalFile(file).toString(QUrl::NormalizePathSegments), false });
  
  Followed by the sort + erase.
  But this is not that slow anyway (remember, to be noticeable it needs to be more than 70.000 files in my 5y old machine)

REPOSITORY
  R40 Kate

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

To: tcanabrava, cullmann, brauch, neundorf
Cc: anthonyfieroni, kwrite-devel, michaelh, kevinapavew, ngraham, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20180928/0586d74c/attachment.html>


More information about the KWrite-Devel mailing list