Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
benchmark
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
benchmark
Commits
2b34b5d9
Commit
2b34b5d9
authored
Mar 12, 2015
by
Eric Fiselier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unneeded includes
parent
937987b6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
30 deletions
+25
-30
benchmark.h
include/benchmark/benchmark.h
+0
-4
benchmark.cc
src/benchmark.cc
+25
-26
No files found.
include/benchmark/benchmark.h
View file @
2b34b5d9
...
...
@@ -138,12 +138,8 @@ BENCHMARK(BM_MultiThreaded)->Threads(4);
#include <cassert>
#include <cstdint>
#include <functional>
#include <memory>
#include <string>
#include <thread>
#include <vector>
#include <mutex>
#include "macros.h"
...
...
src/benchmark.cc
View file @
2b34b5d9
...
...
@@ -327,8 +327,6 @@ static std::unique_ptr<TimerManager> timer_manager = nullptr;
namespace
internal
{
class
BenchmarkFamilies
;
// Information kept per benchmark we may want to run
struct
Benchmark
::
Instance
{
std
::
string
name
;
...
...
@@ -341,6 +339,30 @@ struct Benchmark::Instance {
bool
multithreaded
;
// Is benchmark multi-threaded?
};
// Class for managing registered benchmarks. Note that each registered
// benchmark identifies a family of related benchmarks to run.
class
BenchmarkFamilies
{
public
:
static
BenchmarkFamilies
*
GetInstance
();
// Registers a benchmark family and returns the index assigned to it.
size_t
AddBenchmark
(
BenchmarkImp
*
family
);
// Unregisters a family at the given index.
void
RemoveBenchmark
(
size_t
index
);
// Extract the list of benchmark instances that match the specified
// regular expression.
bool
FindBenchmarks
(
const
std
::
string
&
re
,
std
::
vector
<
Benchmark
::
Instance
>*
benchmarks
);
private
:
BenchmarkFamilies
();
~
BenchmarkFamilies
();
std
::
vector
<
BenchmarkImp
*>
families_
;
Mutex
mutex_
;
};
class
BenchmarkImp
{
public
:
...
...
@@ -367,33 +389,10 @@ private:
std
::
vector
<
std
::
pair
<
int
,
int
>
>
args_
;
// Args for all benchmark runs
std
::
vector
<
int
>
thread_counts_
;
std
::
size_t
registration_index_
;
};
// Class for managing registered benchmarks. Note that each registered
// benchmark identifies a family of related benchmarks to run.
class
BenchmarkFamilies
{
public
:
static
BenchmarkFamilies
*
GetInstance
();
// Registers a benchmark family and returns the index assigned to it.
size_t
AddBenchmark
(
BenchmarkImp
*
family
);
// Unregisters a family at the given index.
void
RemoveBenchmark
(
size_t
index
);
// Extract the list of benchmark instances that match the specified
// regular expression.
bool
FindBenchmarks
(
const
std
::
string
&
re
,
std
::
vector
<
Benchmark
::
Instance
>*
benchmarks
);
private
:
BenchmarkFamilies
();
~
BenchmarkFamilies
();
std
::
vector
<
BenchmarkImp
*>
families_
;
Mutex
mutex_
;
BENCHMARK_DISALLOW_COPY_AND_ASSIGN
(
BenchmarkImp
);
};
BenchmarkFamilies
*
BenchmarkFamilies
::
GetInstance
()
{
static
BenchmarkFamilies
instance
;
return
&
instance
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment