Election-Tech-Initiative / electionguard-cpp

A C++ implementation of ElectionGuard specification focused on encryption components.
https://www.electionguard.vote/
MIT License
23 stars 26 forks source link

Removed lock on the stopping of the precompute. #267

Closed SteveMaier-IRT closed 2 years ago

SteveMaier-IRT commented 2 years ago

Added benchmark to time the stop Precompute functionality.

Fixes #266

Description

Removed the lock that slowed the stop down.

Added the precompute calculation to the benchmarks to see the encrypt time before and after the precompute buffer is filled with data.

Testing

Run the .NET Standard Benchmarks to see the timing on a PC or voting equipment.

ghost commented 2 years ago

CLA assistant check
All CLA requirements met.

SteveMaier-IRT commented 2 years ago

Tested this on equipment before and after the fix to be able to reproduce the issue as well and make sure that it is fixed.

jeffspel-crypto commented 2 years ago

I think this is the correct fix. However, I think it means that the populate is still running even after the stop has been called, doesn't it? Anyway we can tell how long each iteration of the populate is taking on the HART machine (just a real time duration would help)? This makes me think that I should open an issue to check the flag more often than is currently being done.

jeffspel-crypto commented 2 years ago

What I should have said is "Anyway we can tell how long each iteration of the populate loop is taking on the HART machine (just a real time duration would help)?"

SteveMaier-IRT commented 2 years ago

This makes me think that I should open an issue to check the flag more often than is currently being done.

I already tested this with and without what you are talking about here. It is not needed.