Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
300bbe88
Commit
300bbe88
authored
Jul 27, 2008
by
Bradley C. Kuszmaul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add sum64
git-svn-id:
file:///svn/tokudb@5359
c7de825b-a66e-492c-adef-691d508d4ae1
parent
ee5b09ba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
newbrt/hash-benchmarks/hash-benchmark.c
newbrt/hash-benchmarks/hash-benchmark.c
+16
-2
No files found.
newbrt/hash-benchmarks/hash-benchmark.c
View file @
300bbe88
...
...
@@ -27,8 +27,9 @@ static double tdiff (struct timeval *a, struct timeval *b) {
printf("%s=%08x %d bytes in %8.6fs for %8.3fMB/s\n", str, c, N, diff, N*(1e-6)/diff); \
})
int
sum32
(
int
start
,
void
*
buf
,
int
bytecount
)
{
int
sum32
(
void
*
buf
,
int
bytecount
)
{
int
*
ibuf
=
buf
;
int
start
=
0
;
assert
(
bytecount
%
4
==
0
);
while
(
bytecount
>
0
)
{
start
+=*
ibuf
;
...
...
@@ -38,6 +39,18 @@ int sum32 (int start, void *buf, int bytecount) {
return
start
;
}
u_int64_t
sum64
(
void
*
buf
,
int
bytecount
)
{
u_int64_t
*
ibuf
=
buf
;
u_int64_t
start
=
0
;
assert
(
bytecount
%
8
==
0
);
while
(
bytecount
>
0
)
{
start
+=*
ibuf
;
ibuf
++
;
bytecount
-=
8
;
}
return
start
;
}
static
const
u_int32_t
m
=
0x5bd1e995
;
static
const
int
r
=
24
;
static
const
u_int32_t
seed
=
0x3dd3b51a
;
...
...
@@ -1077,7 +1090,8 @@ static void measure_bandwidths (void) {
measure_bandwidth
(
"crc32 "
,
c
=
crc32
(
0
,
buf
,
N
));
measure_bandwidth
(
"crc32by1 "
,
({
c
=
0
;
int
j
;
for
(
j
=
0
;
j
<
N
;
j
++
)
c
=
crc32
(
c
,
buf
+
j
,
1
);
}));
measure_bandwidth
(
"crc32by2 "
,
({
c
=
0
;
int
j
;
for
(
j
=
0
;
j
<
N
;
j
+=
2
)
c
=
crc32
(
c
,
buf
+
j
,
2
);
}));
measure_bandwidth
(
"sum32 "
,
c
=
sum32
(
0
,
buf
,
N
));
measure_bandwidth
(
"sum32 "
,
c
=
sum32
(
buf
,
N
));
measure_bandwidth
(
"sum64 "
,
c
=
sum32
(
buf
,
N
));
measure_bandwidth
(
"murmur "
,
c
=
MurmurHash2
(
buf
,
N
));
measure_bandwidth
(
"murmurf "
,
({
struct
murmur
mm
;
murmur_init
(
&
mm
);
murmur_add
(
&
mm
,
buf
,
N
);
c
=
murmur_finish
(
&
mm
);
}));
measure_bandwidth
(
"sum84 "
,
({
struct
sum84
s
;
sum84_init
(
&
s
);
sum84_add
(
&
s
,
buf
,
N
);
c
=
sum84_finish
(
&
s
);
}));
...
...
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