mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-16 01:07:29 +00:00
Added Google benchmarks (and gtests) (#6920)
* Added Google benchmarks (and gtests) * Default building benchmarks to OFF as it requires c++11 * Separate benchmark CMakeLists.txt to its own file * Move output directory to target just flatbenchmark
This commit is contained in:
19
benchmarks/cpp/bench.h
Normal file
19
benchmarks/cpp/bench.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef BENCHMARKS_CPP_BENCH_H_
|
||||
#define BENCHMARKS_CPP_BENCH_H_
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
struct Bench {
|
||||
virtual ~Bench() {}
|
||||
|
||||
inline void Add(int64_t value) { sum += value; }
|
||||
|
||||
virtual uint8_t *Encode(void *buf, int64_t &len) = 0;
|
||||
virtual void *Decode(void *buf, int64_t len) = 0;
|
||||
virtual int64_t Use(void *decoded) = 0;
|
||||
virtual void Dealloc(void *decoded) = 0;
|
||||
|
||||
int64_t sum = 0;
|
||||
};
|
||||
|
||||
#endif // BENCHMARKS_CPP_BENCH_H_
|
||||
Reference in New Issue
Block a user