D26366: [Kuit] Port QRegExp to QRegularExpression, third pass

Ahmad Samir noreply at phabricator.kde.org
Mon Jan 6 10:00:29 GMT 2020


ahmadsamir added a comment.


  In D26366#588416 <https://phabricator.kde.org/D26366#588416>, @dfaure wrote:
  
  > Benchmarking is complex ;)
  >
  > 1. you need to make sure both Qt and your benchmark are built with optimizations enabled (-O2)
  > 2. you need to actually use those 3 variables otherwise the compiler might optimize out their use. This could be testing their value (NOT with Q_ASSERT if you're in release mode!) and aborting if they don't have the expected value. They will, of course, but the compiler won't know that.
  >
  >   Your current results indicate "54 times slower" ! But indeed on very small numbers...
  
  
  Qt was built with -O2, Tumbleweed default. But my ki18n build was with -O0, changed to -O2 for this test. Added QCOMPARE() calls for all 3 vars:
  
    PASS   : KLocalizedStringTest::benchmarkRegexSimple()
    RESULT : KLocalizedStringTest::benchmarkRegexSimple():
         0.0000056 msecs per iteration (total: 94, iterations: 16777216)
    PASS   : KLocalizedStringTest::benchmarkRegex2()
    RESULT : KLocalizedStringTest::benchmarkRegex2():
         0.00043 msecs per iteration (total: 57, iterations: 131072)

REPOSITORY
  R249 KI18n

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

To: ahmadsamir, #frameworks, ilic, dfaure, mlaurent, aacid
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200106/0f08d738/attachment.html>


More information about the Kde-frameworks-devel mailing list