In this code drop we introduce the benchmarking tests that allow us to
compare the performance of different implementations. Like the other
tests, any implementation can link with them to create their own
binary.
There are two types of benchmarks:
1 - Throughput, which measures the speed that a function can process
information (bits per second). These are used for AEAD decrypt
and license white-box decrypt functions.
2 - Samples, which measures the min, 25% percentile, median, 75%
percentile, and max observed values. These is used for all other
functions as a way to measure the execute duration of a call.
The other change in this code drop is the update to the unmasking
function to only unmask a subset of the bytes in the masked buffer.
This was added to better align with the decoder behaviour in the CDM.
24 lines
408 B
C++
24 lines
408 B
C++
// Copyright 2020 Google LLC. All Rights Reserved.
|
|
|
|
#ifndef WHITEBOX_BENCHMARKING_DATA_SOURCE_H_
|
|
#define WHITEBOX_BENCHMARKING_DATA_SOURCE_H_
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#include <vector>
|
|
|
|
namespace widevine {
|
|
|
|
class DataSource {
|
|
public:
|
|
std::vector<uint8_t> Get(size_t size);
|
|
|
|
private:
|
|
size_t read_head_ = 0;
|
|
};
|
|
|
|
} // namespace widevine
|
|
|
|
#endif // WHITEBOX_BENCHMARKING_DATA_SOURCE_H_
|