D19766: Improve performance of cliplugins

Ragnar Thomsen noreply at phabricator.kde.org
Thu Mar 14 19:05:44 GMT 2019


rthomsen created this revision.
rthomsen added a reviewer: elvisangelaccio.
rthomsen added a project: Ark.
Herald added subscribers: Ark, kde-utils-devel.
rthomsen requested review of this revision.

REVISION SUMMARY
  The CliPlugins are really slow when listing and extracting archives. This is due to several `QRegularExpression`s being matched on each line of output.
  
  This diff removes all of the `QRegularExpression` matchings and uses string comparison instead (e.g. `startsWith()`, `contains()` and `==()`). This necessitated moving the checks from the `CliProperties` class to the individual `CliPlugins`, because each plugin has different requirements to which string comparison methods should be used.
  
  Some numbers for my system (6.gen. Core i7 with SSD). Listing linux kernel source archive:
  clirar: Before 167 secs, after 7 secs
  cli7z: Before 216 secs, after 37 secs
  clizip: Before 15 secs, after 5 secs
  
  The difference was less when extracting due to fewer regexp being matched, but still noticable.

TEST PLAN
  All unit tests pass.
  
  - Password prompt is still detected.
  - Wrong password prompt is still detected.
  - Corrupt archive prompt is still detected.
  - Disk full prompt is still detected.
  - File exists prompt is still detected.

REPOSITORY
  R36 Ark

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

AFFECTED FILES
  kerfuffle/cliinterface.cpp
  kerfuffle/cliinterface.h
  kerfuffle/cliproperties.cpp
  kerfuffle/cliproperties.h
  plugins/cli7zplugin/cliplugin.cpp
  plugins/cli7zplugin/cliplugin.h
  plugins/clirarplugin/cliplugin.cpp
  plugins/clirarplugin/cliplugin.h
  plugins/cliunarchiverplugin/cliplugin.cpp
  plugins/cliunarchiverplugin/cliplugin.h
  plugins/clizipplugin/cliplugin.cpp
  plugins/clizipplugin/cliplugin.h

To: rthomsen, elvisangelaccio
Cc: kde-utils-devel, #ark, tctara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-utils-devel/attachments/20190314/84aa93fb/attachment.html>


More information about the Kde-utils-devel mailing list