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
279e502a
Commit
279e502a
authored
Mar 17, 2015
by
Eric Fiselier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test for benchmark with two template parameters
parent
7f2ef462
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
benchmark_test.cc
test/benchmark_test.cc
+5
-5
No files found.
test/benchmark_test.cc
View file @
279e502a
...
@@ -106,20 +106,20 @@ static void BM_SetInsert(benchmark::State& state) {
...
@@ -106,20 +106,20 @@ static void BM_SetInsert(benchmark::State& state) {
}
}
BENCHMARK
(
BM_SetInsert
)
->
RangePair
(
1
<<
10
,
8
<<
10
,
1
,
10
);
BENCHMARK
(
BM_SetInsert
)
->
RangePair
(
1
<<
10
,
8
<<
10
,
1
,
10
);
template
<
typename
Q
>
template
<
typename
Container
,
typename
ValueType
=
typename
Container
::
value_type
>
static
void
BM_Sequential
(
benchmark
::
State
&
state
)
{
static
void
BM_Sequential
(
benchmark
::
State
&
state
)
{
typename
Q
::
value_t
ype
v
=
42
;
ValueT
ype
v
=
42
;
while
(
state
.
KeepRunning
())
{
while
(
state
.
KeepRunning
())
{
Q
q
;
Container
c
;
for
(
int
i
=
state
.
range_x
();
--
i
;
)
for
(
int
i
=
state
.
range_x
();
--
i
;
)
q
.
push_back
(
v
);
c
.
push_back
(
v
);
}
}
const
int64_t
items_processed
=
const
int64_t
items_processed
=
static_cast
<
int64_t
>
(
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
));
}
}
BENCHMARK_TEMPLATE
(
BM_Sequential
,
std
::
vector
<
int
>
)
->
Range
(
1
<<
0
,
1
<<
10
);
BENCHMARK_TEMPLATE
2
(
BM_Sequential
,
std
::
vector
<
int
>
,
int
)
->
Range
(
1
<<
0
,
1
<<
10
);
BENCHMARK_TEMPLATE
(
BM_Sequential
,
std
::
list
<
int
>
)
->
Range
(
1
<<
0
,
1
<<
10
);
BENCHMARK_TEMPLATE
(
BM_Sequential
,
std
::
list
<
int
>
)
->
Range
(
1
<<
0
,
1
<<
10
);
static
void
BM_StringCompare
(
benchmark
::
State
&
state
)
{
static
void
BM_StringCompare
(
benchmark
::
State
&
state
)
{
...
...
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