samuel-lucas6 / Kryptor

A simple, modern, and secure encryption and signing tool that aims to be a better version of age and Minisign.
https://www.kryptor.co.uk
GNU General Public License v3.0
414 stars 33 forks source link

🐛 Bug: Some warmup is needed before launching 'Test Parameters' or Argon2 benchmark #3

Closed Raviu56 closed 3 years ago

Raviu56 commented 3 years ago

Describe the bug As power management is usual on Laptops/PCs, CPU frequency is usually low until some more work is being done.

To Reproduce On my Linux test with version 2.1.0 beta, here are the 1st few lines from benchmark.txt:

50 MiB = 155 ms
55 MiB = 72 ms
60 MiB = 76 ms
65 MiB = 80 ms
70 MiB = 83 ms
75 MiB = 89 ms
80 MiB = 97 ms
85 MiB = 101 ms
90 MiB = 107 ms
95 MiB = 113 ms
100 MiB = 121 ms
105 MiB = 125 ms
110 MiB = 131 ms
115 MiB = 137 ms
120 MiB = 146 ms
125 MiB = 151 ms
130 MiB = 156 ms
135 MiB = 162 ms
140 MiB = 167 ms

Also later on if I run "Test Parameteres" it always gives very bad results compared to initial benchmarks unless I'm running some CPU eating process to warm up CPU - like yes >/dev/null - before running the test.

Expected behaviour Should warm-up, like running the 1st test 2 times, discard results, then start counting.

Desktop (please complete the following information):

Thanks for the app :rose:

samuel-lucas6 commented 3 years ago

Hi Raviu56, thanks for making this report. This is something I have noticed as well. It must be an issue with the timer getting started. I will look into running the first memory size and 'Test Parameters' twice and discarding the first result. I'll try and patch this for the next release :)

samuel-lucas6 commented 3 years ago

This issue should be fixed in version 2.1.1.