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
11e30435
Commit
11e30435
authored
Jun 02, 2016
by
Ismael
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checked format before pull request
parent
212cfe1c
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
17 deletions
+17
-17
benchmark_api.h
include/benchmark/benchmark_api.h
+1
-1
reporter.h
include/benchmark/reporter.h
+2
-2
benchmark.cc
src/benchmark.cc
+6
-6
complexity.cc
src/complexity.cc
+0
-0
complexity.h
src/complexity.h
+7
-7
json_reporter.cc
src/json_reporter.cc
+1
-1
No files found.
include/benchmark/benchmark_api.h
View file @
11e30435
...
@@ -263,7 +263,7 @@ public:
...
@@ -263,7 +263,7 @@ public:
State
(
size_t
max_iters
,
bool
has_x
,
int
x
,
bool
has_y
,
int
y
,
State
(
size_t
max_iters
,
bool
has_x
,
int
x
,
bool
has_y
,
int
y
,
int
thread_i
,
int
n_threads
);
int
thread_i
,
int
n_threads
);
// Returns true if
f
the benchmark should continue through another iteration.
// Returns true if the benchmark should continue through another iteration.
// NOTE: A benchmark may not return from the test until KeepRunning() has
// NOTE: A benchmark may not return from the test until KeepRunning() has
// returned false.
// returned false.
bool
KeepRunning
()
{
bool
KeepRunning
()
{
...
...
include/benchmark/reporter.h
View file @
11e30435
...
@@ -156,11 +156,11 @@ private:
...
@@ -156,11 +156,11 @@ private:
// Simple reporter that outputs benchmark data to the console. This is the
// Simple reporter that outputs benchmark data to the console. This is the
// default reporter used by RunSpecifiedBenchmarks().
// default reporter used by RunSpecifiedBenchmarks().
class
ConsoleReporter
:
public
BenchmarkReporter
{
class
ConsoleReporter
:
public
BenchmarkReporter
{
public
:
public
:
virtual
bool
ReportContext
(
const
Context
&
context
);
virtual
bool
ReportContext
(
const
Context
&
context
);
virtual
void
ReportRuns
(
const
std
::
vector
<
Run
>&
reports
);
virtual
void
ReportRuns
(
const
std
::
vector
<
Run
>&
reports
);
protected
:
protected
:
virtual
void
PrintRunData
(
const
Run
&
report
);
virtual
void
PrintRunData
(
const
Run
&
report
);
size_t
name_field_width_
;
size_t
name_field_width_
;
...
...
src/benchmark.cc
View file @
11e30435
...
@@ -964,9 +964,9 @@ void State::SetLabel(const char* label) {
...
@@ -964,9 +964,9 @@ void State::SetLabel(const char* label) {
}
}
namespace
internal
{
namespace
internal
{
namespace
{
namespace
{
void
RunMatchingBenchmarks
(
const
std
::
vector
<
Benchmark
::
Instance
>&
benchmarks
,
void
RunMatchingBenchmarks
(
const
std
::
vector
<
Benchmark
::
Instance
>&
benchmarks
,
BenchmarkReporter
*
reporter
)
{
BenchmarkReporter
*
reporter
)
{
CHECK
(
reporter
!=
nullptr
);
CHECK
(
reporter
!=
nullptr
);
...
@@ -997,9 +997,9 @@ namespace internal {
...
@@ -997,9 +997,9 @@ namespace internal {
RunBenchmark
(
benchmark
,
reporter
,
complexity_reports
);
RunBenchmark
(
benchmark
,
reporter
,
complexity_reports
);
}
}
}
}
}
}
std
::
unique_ptr
<
BenchmarkReporter
>
GetDefaultReporter
()
{
std
::
unique_ptr
<
BenchmarkReporter
>
GetDefaultReporter
()
{
typedef
std
::
unique_ptr
<
BenchmarkReporter
>
PtrType
;
typedef
std
::
unique_ptr
<
BenchmarkReporter
>
PtrType
;
if
(
FLAGS_benchmark_format
==
"console"
)
{
if
(
FLAGS_benchmark_format
==
"console"
)
{
return
PtrType
(
new
ConsoleReporter
);
return
PtrType
(
new
ConsoleReporter
);
...
@@ -1011,9 +1011,9 @@ namespace internal {
...
@@ -1011,9 +1011,9 @@ namespace internal {
std
::
cerr
<<
"Unexpected format: '"
<<
FLAGS_benchmark_format
<<
"'
\n
"
;
std
::
cerr
<<
"Unexpected format: '"
<<
FLAGS_benchmark_format
<<
"'
\n
"
;
std
::
exit
(
1
);
std
::
exit
(
1
);
}
}
}
}
}
// end namespace
}
// end namespace
}
// end namespace internal
}
// end namespace internal
size_t
RunSpecifiedBenchmarks
()
{
size_t
RunSpecifiedBenchmarks
()
{
...
...
src/complexity.cc
View file @
11e30435
src/complexity.h
View file @
11e30435
...
@@ -26,15 +26,15 @@
...
@@ -26,15 +26,15 @@
namespace
benchmark
{
namespace
benchmark
{
// Return a vector containing the mean and standard devation information for
// Return a vector containing the mean and standard devation information for
// the specified list of reports. If 'reports' contains less than two
// the specified list of reports. If 'reports' contains less than two
// non-errored runs an empty vector is returned
// non-errored runs an empty vector is returned
std
::
vector
<
BenchmarkReporter
::
Run
>
ComputeStats
(
std
::
vector
<
BenchmarkReporter
::
Run
>
ComputeStats
(
const
std
::
vector
<
BenchmarkReporter
::
Run
>&
reports
);
const
std
::
vector
<
BenchmarkReporter
::
Run
>&
reports
);
// Return a vector containing the bigO and RMS information for the specified
// Return a vector containing the bigO and RMS information for the specified
// list of reports. If 'reports.size() < 2' an empty vector is returned.
// list of reports. If 'reports.size() < 2' an empty vector is returned.
std
::
vector
<
BenchmarkReporter
::
Run
>
ComputeBigO
(
std
::
vector
<
BenchmarkReporter
::
Run
>
ComputeBigO
(
const
std
::
vector
<
BenchmarkReporter
::
Run
>&
reports
);
const
std
::
vector
<
BenchmarkReporter
::
Run
>&
reports
);
// This data structure will contain the result returned by MinimalLeastSq
// This data structure will contain the result returned by MinimalLeastSq
...
...
src/json_reporter.cc
View file @
11e30435
...
@@ -155,7 +155,7 @@ void JSONReporter::PrintRunData(Run const& run) {
...
@@ -155,7 +155,7 @@ void JSONReporter::PrintRunData(Run const& run) {
}
else
if
(
run
.
report_rms
)
{
}
else
if
(
run
.
report_rms
)
{
out
<<
indent
out
<<
indent
<<
FormatKV
(
"rms"
,
RoundDouble
(
run
.
GetAdjustedCPUTime
()
*
100
))
<<
FormatKV
(
"rms"
,
RoundDouble
(
run
.
GetAdjustedCPUTime
()
*
100
))
<<
"%"
;
<<
'%'
;
}
}
if
(
run
.
bytes_per_second
>
0.0
)
{
if
(
run
.
bytes_per_second
>
0.0
)
{
out
<<
",
\n
"
<<
indent
out
<<
",
\n
"
<<
indent
...
...
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