Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
7b330237
Commit
7b330237
authored
Mar 26, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweaks.
parent
e950e6bf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
11 deletions
+12
-11
capnproto-catrank.c++
c++/src/capnproto/benchmark/capnproto-catrank.c++
+2
-3
null-catrank.c++
c++/src/capnproto/benchmark/null-catrank.c++
+2
-4
protobuf-catrank.c++
c++/src/capnproto/benchmark/protobuf-catrank.c++
+3
-2
runner.c++
c++/src/capnproto/benchmark/runner.c++
+5
-2
No files found.
c++/src/capnproto/benchmark/capnproto-catrank.c++
View file @
7b330237
...
...
@@ -91,8 +91,7 @@ public:
return
goodCount
;
}
static
inline
void
handleRequest
(
SearchResultList
::
Reader
request
,
SearchResultList
::
Builder
response
)
{
static
void
handleRequest
(
SearchResultList
::
Reader
request
,
SearchResultList
::
Builder
response
)
{
std
::
vector
<
ScoredResult
>
scoredResults
;
for
(
auto
result
:
request
.
getResults
())
{
...
...
@@ -118,7 +117,7 @@ public:
}
}
static
inline
bool
checkResponse
(
SearchResultList
::
Reader
response
,
int
expectedGoodCount
)
{
static
bool
checkResponse
(
SearchResultList
::
Reader
response
,
int
expectedGoodCount
)
{
int
goodCount
=
0
;
for
(
auto
result
:
response
.
getResults
())
{
if
(
result
.
getScore
()
>
1001
)
{
...
...
c++/src/capnproto/benchmark/null-catrank.c++
View file @
7b330237
...
...
@@ -117,8 +117,7 @@ public:
return
goodCount
;
}
static
inline
void
handleRequest
(
const
List
<
SearchResult
>&
request
,
List
<
SearchResult
>*
response
)
{
static
void
handleRequest
(
const
List
<
SearchResult
>&
request
,
List
<
SearchResult
>*
response
)
{
std
::
vector
<
ScoredResult
>
scoredResults
;
scoredResults
.
reserve
(
request
.
size
);
...
...
@@ -145,8 +144,7 @@ public:
}
}
static
inline
bool
checkResponse
(
const
List
<
SearchResult
>&
response
,
int
expectedGoodCount
)
{
static
bool
checkResponse
(
const
List
<
SearchResult
>&
response
,
int
expectedGoodCount
)
{
int
goodCount
=
0
;
for
(
auto
&
result
:
response
)
{
if
(
result
.
score
>
1001
)
{
...
...
c++/src/capnproto/benchmark/protobuf-catrank.c++
View file @
7b330237
...
...
@@ -63,6 +63,7 @@ public:
goodCount
+=
isCat
&&
!
isDog
;
std
::
string
*
snippet
=
result
->
mutable_snippet
();
snippet
->
reserve
(
7
*
22
);
snippet
->
push_back
(
' '
);
int
prefix
=
fastRand
(
20
);
...
...
@@ -82,7 +83,7 @@ public:
return
goodCount
;
}
static
inline
void
handleRequest
(
const
SearchResultList
&
request
,
SearchResultList
*
response
)
{
static
void
handleRequest
(
const
SearchResultList
&
request
,
SearchResultList
*
response
)
{
std
::
vector
<
ScoredResult
>
scoredResults
;
for
(
auto
&
result
:
request
.
result
())
{
...
...
@@ -106,7 +107,7 @@ public:
}
}
static
inline
bool
checkResponse
(
const
SearchResultList
&
response
,
int
expectedGoodCount
)
{
static
bool
checkResponse
(
const
SearchResultList
&
response
,
int
expectedGoodCount
)
{
int
goodCount
=
0
;
for
(
auto
&
result
:
response
.
result
())
{
if
(
result
.
score
()
>
1001
)
{
...
...
c++/src/capnproto/benchmark/runner.c++
View file @
7b330237
...
...
@@ -358,6 +358,9 @@ int main(int argc, char* argv[]) {
reuse
=
Reuse
::
NO
;
}
else
if
(
arg
==
"snappy"
)
{
compression
=
Compression
::
SNAPPY
;
}
else
{
fprintf
(
stderr
,
"Unknown option: %s
\n
"
,
argv
[
i
]);
return
1
;
}
}
...
...
@@ -456,8 +459,8 @@ int main(int argc, char* argv[]) {
reportComparison
(
"object manipulation"
,
nullCase
.
time
.
cpu
(),
protobufBase
.
time
.
cpu
(),
capnpBase
.
time
.
cpu
(),
iters
);
reportComparison
(
"I/O"
,
"us"
,
(
protobuf
.
time
.
cpu
()
-
protobufBase
.
time
.
cpu
())
/
1000.0
,
(
capnp
.
time
.
cpu
()
-
capnpBase
.
time
.
cpu
())
/
1000.0
,
iters
);
(
(
int64_t
)
protobuf
.
time
.
cpu
()
-
(
int64_t
)
protobufBase
.
time
.
cpu
())
/
1000.0
,
(
(
int64_t
)
capnp
.
time
.
cpu
()
-
(
int64_t
)
capnpBase
.
time
.
cpu
())
/
1000.0
,
iters
);
reportComparison
(
"binary size"
,
"kB"
,
fileSize
(
"protobuf-"
+
std
::
string
(
testCaseName
(
testCase
)))
/
1024.0
,
...
...
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