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
ed0a2eb7
Commit
ed0a2eb7
authored
Oct 01, 2015
by
Eric Fiselier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use size_t instead of int for the iteration count
parent
cf40a0f1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
benchmark.cc
src/benchmark.cc
+2
-2
benchmark_test.cc
test/benchmark_test.cc
+1
-2
No files found.
src/benchmark.cc
View file @
ed0a2eb7
...
@@ -596,7 +596,7 @@ namespace {
...
@@ -596,7 +596,7 @@ namespace {
// Execute one thread of benchmark b for the specified number of iterations.
// Execute one thread of benchmark b for the specified number of iterations.
// Adds the stats collected for the thread into *total.
// Adds the stats collected for the thread into *total.
void
RunInThread
(
const
benchmark
::
internal
::
Benchmark
::
Instance
*
b
,
void
RunInThread
(
const
benchmark
::
internal
::
Benchmark
::
Instance
*
b
,
in
t
iters
,
int
thread_id
,
size_
t
iters
,
int
thread_id
,
ThreadStats
*
total
)
EXCLUDES
(
GetBenchmarkLock
())
{
ThreadStats
*
total
)
EXCLUDES
(
GetBenchmarkLock
())
{
State
st
(
iters
,
b
->
has_arg1
,
b
->
arg1
,
b
->
has_arg2
,
b
->
arg2
,
thread_id
);
State
st
(
iters
,
b
->
has_arg1
,
b
->
arg1
,
b
->
has_arg2
,
b
->
arg2
,
thread_id
);
b
->
benchmark
->
Run
(
st
);
b
->
benchmark
->
Run
(
st
);
...
@@ -613,7 +613,7 @@ void RunInThread(const benchmark::internal::Benchmark::Instance* b,
...
@@ -613,7 +613,7 @@ void RunInThread(const benchmark::internal::Benchmark::Instance* b,
void
RunBenchmark
(
const
benchmark
::
internal
::
Benchmark
::
Instance
&
b
,
void
RunBenchmark
(
const
benchmark
::
internal
::
Benchmark
::
Instance
&
b
,
BenchmarkReporter
*
br
)
EXCLUDES
(
GetBenchmarkLock
())
{
BenchmarkReporter
*
br
)
EXCLUDES
(
GetBenchmarkLock
())
{
in
t
iters
=
1
;
size_
t
iters
=
1
;
std
::
vector
<
BenchmarkReporter
::
Run
>
reports
;
std
::
vector
<
BenchmarkReporter
::
Run
>
reports
;
...
...
test/benchmark_test.cc
View file @
ed0a2eb7
...
@@ -101,8 +101,7 @@ static void BM_Sequential(benchmark::State& state) {
...
@@ -101,8 +101,7 @@ static void BM_Sequential(benchmark::State& state) {
for
(
int
i
=
state
.
range_x
();
--
i
;
)
for
(
int
i
=
state
.
range_x
();
--
i
;
)
c
.
push_back
(
v
);
c
.
push_back
(
v
);
}
}
const
int64_t
items_processed
=
const
size_t
items_processed
=
state
.
iterations
()
*
state
.
range_x
();
static_cast
<
int64_t
>
(
state
.
iterations
())
*
state
.
range_x
();
state
.
SetItemsProcessed
(
items_processed
);
state
.
SetItemsProcessed
(
items_processed
);
state
.
SetBytesProcessed
(
items_processed
*
sizeof
(
v
));
state
.
SetBytesProcessed
(
items_processed
*
sizeof
(
v
));
}
}
...
...
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