Skip to content

Possible Performance Degradation of HQC128 through Update to 2023-04-30 Submission #2047

@BartBBM

Description

@BartBBM

Describe the bug
When running ./speed_kem HQC-128 from the build/tests directory there is a big performance degradation, introduced by #1585 by @SWilson4.

I wanna mention, that it just may be the effect of not having an avx2 implementation anymore, as mentioned here PQClean/PQClean#512. If this is the reason, then consider my bug report solved.

To Reproduce
Steps to reproduce the behavior:

  1. Checkout tags/0.10.0
  2. Build liboqs
  3. Run performance test ./speed_kem HQC-128
  4. See slow performance
  5. Checkout tags/0.9.2
  6. Build liboqs
  7. Run performance test ./speed_kem HQC-128
  8. See faster performance

Expected behavior
No performance degradation this big.

Logs

0.10.0

Configuration info
==================
Target platform:  x86_64-Linux-5.15.153.1-bebbo-WSL2-local-166808-g33cad9854e0b
Compiler:         gcc (13.3.0)
Compile options:  [-Wa,--noexecstack;-O3;-fomit-frame-pointer;-fdata-sections;-ffunction-sections;-Wl,--gc-sections;-Wbad-function-cast]
OQS version:      0.10.0
Git commit:       36be57445d8ca53f7095160fde548efe82ace09d
OpenSSL enabled:  Yes (OpenSSL 3.4.0 22 Oct 2024)
AES:              NI
SHA-2:            OpenSSL
SHA-3:            C
OQS build flags:  OQS_DIST_BUILD OQS_OPT_TARGET=generic CMAKE_BUILD_TYPE=Release 
CPU exts active:  ADX AES AVX AVX2 BMI1 BMI2 PCLMULQDQ POPCNT SSE SSE2 SSE3
Speed test
==========
Started at 2025-01-21 16:27:22
Operation                            | Iterations | Total time (s) | Time (us): mean | pop. stdev | CPU cycles: mean          | pop. stdev
------------------------------------ | ----------:| --------------:| ---------------:| ----------:| -------------------------:| ----------:
HQC-128                              |            |                |                 |            |                           |           
keygen                               |       1731 |          3.001 |        1733.832 |    184.774 |                   5881185 |     626126
encaps                               |        883 |          3.003 |        3400.411 |    168.300 |                  11526433 |     570244
decaps                               |        546 |          3.004 |        5501.266 |    898.510 |                  18647074 |    3045484
Ended at 2025-01-21 16:27:31

0.9.2

Configuration info
==================
Target platform:  x86_64-Linux-5.15.153.1-bebbo-WSL2-local-166808-g33cad9854e0b
Compiler:         gcc (13.3.0)
Compile options:  [-Wa,--noexecstack;-O3;-fomit-frame-pointer;-fdata-sections;-ffunction-sections;-Wl,--gc-sections;-Wbad-function-cast]
OQS version:      0.9.2
Git commit:       62b58a34fbbcc1cb23f2c090c8a19b090ebf1aa2
OpenSSL enabled:  Yes (OpenSSL 3.4.0 22 Oct 2024)
AES:              NI
SHA-2:            OpenSSL
SHA-3:            C
OQS build flags:  OQS_DIST_BUILD OQS_OPT_TARGET=generic CMAKE_BUILD_TYPE=Release 
CPU exts active:  ADX AES AVX AVX2 BMI1 BMI2 PCLMULQDQ POPCNT SSE SSE2 SSE3
Speed test
==========
Started at 2025-01-21 16:23:16
Operation                            | Iterations | Total time (s) | Time (us): mean | pop. stdev | CPU cycles: mean          | pop. stdev
------------------------------------ | ----------:| --------------:| ---------------:| ----------:| -------------------------:| ----------:
HQC-128                              |            |                |                 |            |                           |           
keygen                               |      87515 |          3.000 |          34.280 |     16.798 |                    116235 |      56934
encaps                               |      45523 |          3.000 |          65.902 |     40.549 |                    223264 |     137396
decaps                               |      25801 |          3.000 |         116.275 |     18.582 |                    393633 |      62858
Ended at 2025-01-21 16:23:25

Environment (please complete the following information):

  • OS: Ubuntu 24.04.1 LTS
  • OpenSSL version 3.4.0
  • Compiler version used: gcc (13.3.0)
  • Build variables used: none
  • liboqs version: different versions, see 'to reproduce'

Additional context
I used git bisect to find the exact commit introducing this behaviour.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions