Skip to content

Commit

Permalink
Report BoringSSL benchmark speeds in us and add READMEs.
Browse files Browse the repository at this point in the history
  • Loading branch information
xvzcf committed Sep 12, 2023
1 parent 4ad7ff2 commit 54adf2a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
11 changes: 11 additions & 0 deletions benches/boringssl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
This directory contains programs for benchmarking various algorithms implemented
by BoringSSL, so as to compare their performance with the implementations in
libcrux. As of now, there is only a program to benchmark Kyber768.

In order to build this benchmark, run the following sequence of commands:

1. `mkdir build && cd build`
2. `cmake -G"Ninja" ..`
3. `ninja`

To then run the benchmark, in the `build` directory, simply run `./kyber768`
7 changes: 2 additions & 5 deletions benches/boringssl/kyber768.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@

static const uint64_t SECONDS_TO_MEASURE_FOR = 1;

static const double MICROSECONDS_IN_A_MILLISECOND = 1000.0;

// TimeResults represents the results of benchmarking a function.
struct TimeResults {
// num_calls is the number of function calls done in the time period.
Expand All @@ -39,9 +37,8 @@ struct TimeResults {
uint64_t us;

void Print(const std::string &description) const {
printf("Each %s operation took %f milliseconds.\n", description.c_str(),
(static_cast<double>(us) / MICROSECONDS_IN_A_MILLISECOND) /
static_cast<double>(num_calls));
printf("Each %s operation took %f microseconds.\n", description.c_str(),
static_cast<double>(us) / static_cast<double>(num_calls));
}
};

Expand Down
5 changes: 5 additions & 0 deletions benches/circl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This directory contains programs for benchmarking various algorithms implemented
by CIRCL, so as to compare their performance with the implementations in
libcrux. As of now, there is only a program to benchmark Kyber768.

In order to run this benchmark, simply run `make`.

0 comments on commit 54adf2a

Please sign in to comment.