openssl / perftools

Performance testing tools
Apache License 2.0
4 stars 4 forks source link

evp_setpeer returns 0 on Windows #16

Open quarckster opened 1 month ago

quarckster commented 1 month ago

evp_setpeer returns 0.000000 on Windows 10 both x86 and x86_64 if perftools. Below is the table with results for various evp_setpeer runs built with OpenSSL 1.1.1. Each result is an average of 25 runs.

benchmark           platform            threads  result
evp_setpeer dh      windows-10-x86      1        0.064
evp_setpeer dh      windows-10-x86      10       0.0
evp_setpeer dh      windows-10-x86      100      0.128
evp_setpeer ec256   windows-10-x86      1        1.564
evp_setpeer ec256   windows-10-x86      10       1.48
evp_setpeer ec256   windows-10-x86      100      1.568
evp_setpeer ec521   windows-10-x86      1        2.124
evp_setpeer ec521   windows-10-x86      10       2.248
evp_setpeer ec521   windows-10-x86      100      2.44
evp_setpeer ec521   windows-10-x86_64   1        1.62
evp_setpeer ec521   windows-10-x86_64   10       2.116
evp_setpeer ec521   windows-10-x86_64   100      2.004
evp_setpeer ec521   windows-10-x86_64   500      2.06
evp_setpeer x25519  windows-10-x86_64   1        0.0
evp_setpeer x25519  windows-10-x86_64   10       0.06
evp_setpeer x25519  windows-10-x86_64   100      0.06
evp_setpeer x25519  windows-10-x86_64   500      0.0
evp_setpeer x25519  windows-10-x86      1        0.0
evp_setpeer x25519  windows-10-x86      10       0.0
evp_setpeer x25519  windows-10-x86      100      0.0

On the other hand evp_setpeer never returns 0.000000 on other platforms on the same CPU.

Sashan commented 1 month ago

It's been pointed out on chat. Each thread executes a loop to gather desired performance data

for (i = 0; i < num_calls / threadcount; i++) {

the numcalls in evp_setpeer test tool is set to 10000. if we run 500 (or 100) threads, then the loop performs just 20 (or 100) iterations. May be we should change this strategy. One option is to let all threads run for fixed amount of time (30 seconds for example) and count number of iterations of each test.

t8m commented 1 month ago

30 seconds would be definitely too much given we then call the whole test many times to obtain the statistics (average + std)