<table><tr><td style="">rthomsen created this revision.<br />rthomsen added a reviewer: elvisangelaccio.<br />rthomsen added a project: Ark.<br />Herald added subscribers: Ark, kde-utils-devel.<br />rthomsen requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D19766">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The CliPlugins are really slow when listing and extracting archives. This is due to several <tt style="background: #ebebeb; font-size: 13px;">QRegularExpression</tt>s being matched on each line of output.</p>

<p>This diff removes all of the <tt style="background: #ebebeb; font-size: 13px;">QRegularExpression</tt> matchings and uses string comparison instead (e.g. <tt style="background: #ebebeb; font-size: 13px;">startsWith()</tt>, <tt style="background: #ebebeb; font-size: 13px;">contains()</tt> and <tt style="background: #ebebeb; font-size: 13px;">==()</tt>). This necessitated moving the checks from the <tt style="background: #ebebeb; font-size: 13px;">CliProperties</tt> class to the individual <tt style="background: #ebebeb; font-size: 13px;">CliPlugins</tt>, because each plugin has different requirements to which string comparison methods should be used.</p>

<p>Some numbers for my system (6.gen. Core i7 with SSD). Listing linux kernel source archive:<br />
clirar: Before 167 secs, after 7 secs<br />
cli7z: Before 216 secs, after 37 secs<br />
clizip: Before 15 secs, after 5 secs</p>

<p>The difference was less when extracting due to fewer regexp being matched, but still noticable.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>All unit tests pass.</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">Password prompt is still detected.</li>
<li class="remarkup-list-item">Wrong password prompt is still detected.</li>
<li class="remarkup-list-item">Corrupt archive prompt is still detected.</li>
<li class="remarkup-list-item">Disk full prompt is still detected.</li>
<li class="remarkup-list-item">File exists prompt is still detected.</li>
</ul></div></div><br /><div><strong>REPOSITORY</strong><div><div>R36 Ark</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D19766">https://phabricator.kde.org/D19766</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>kerfuffle/cliinterface.cpp<br />
kerfuffle/cliinterface.h<br />
kerfuffle/cliproperties.cpp<br />
kerfuffle/cliproperties.h<br />
plugins/cli7zplugin/cliplugin.cpp<br />
plugins/cli7zplugin/cliplugin.h<br />
plugins/clirarplugin/cliplugin.cpp<br />
plugins/clirarplugin/cliplugin.h<br />
plugins/cliunarchiverplugin/cliplugin.cpp<br />
plugins/cliunarchiverplugin/cliplugin.h<br />
plugins/clizipplugin/cliplugin.cpp<br />
plugins/clizipplugin/cliplugin.h</div></div></div><br /><div><strong>To: </strong>rthomsen, elvisangelaccio<br /><strong>Cc: </strong>kde-utils-devel, Ark, tctara<br /></div>