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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
d7408933
Commit
d7408933
authored
Oct 17, 2007
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add keysize and valsize
git-svn-id:
file:///svn/tokudb@489
c7de825b-a66e-492c-adef-691d508d4ae1
parent
f0d3ad7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
9 deletions
+30
-9
newbrt/benchmark-test.c
newbrt/benchmark-test.c
+30
-9
No files found.
newbrt/benchmark-test.c
View file @
d7408933
...
...
@@ -18,11 +18,14 @@ enum { BOUND_INCREASE_PER_ITERATION = SERIAL_SPACING*ITEMS_TO_INSERT_PER_ITERATI
enum
{
NODE_SIZE
=
1
<<
20
};
int
nodesize
=
NODE_SIZE
;
int
keysize
=
sizeof
(
long
long
);
int
valsize
=
sizeof
(
long
long
);
CACHETABLE
ct
;
BRT
t
;
void
setup
(
int
nodesize
)
{
printf
(
"nodesize=%d
\n
"
,
nodesize
);
void
setup
(
void
)
{
int
r
;
unlink
(
fname
);
r
=
brt_create_cachetable
(
&
ct
,
0
);
assert
(
r
==
0
);
...
...
@@ -41,11 +44,13 @@ void long_long_to_array (unsigned char *a, unsigned long long l) {
}
void
insert
(
long
long
v
)
{
unsigned
char
kc
[
8
],
vc
[
8
];
unsigned
char
kc
[
keysize
],
vc
[
valsize
];
DBT
kt
,
vt
;
memset
(
kc
,
0
,
sizeof
kc
);
long_long_to_array
(
kc
,
v
);
memset
(
vc
,
0
,
sizeof
vc
);
long_long_to_array
(
vc
,
v
);
brt_insert
(
t
,
fill_dbt
(
&
kt
,
kc
,
8
),
fill_dbt
(
&
vt
,
vc
,
8
),
0
,
0
);
brt_insert
(
t
,
fill_dbt
(
&
kt
,
kc
,
keysize
),
fill_dbt
(
&
vt
,
vc
,
valsize
),
0
,
0
);
}
void
serial_insert_from
(
long
long
from
)
{
...
...
@@ -89,13 +94,10 @@ void biginsert (long long n_elements, struct timeval *starttime) {
}
void
usage
()
{
printf
(
"benchmark-test [--nodesize NODESIZE] [TOTALITEMS]
\n
"
);
printf
(
"benchmark-test [--nodesize NODESIZE] [
--keysize KEYSIZE] [--valsize VALSIZE] [
TOTALITEMS]
\n
"
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
/* set defaults */
int
nodesize
=
NODE_SIZE
;
/* parse parameters */
int
i
;
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
...
...
@@ -110,6 +112,22 @@ int main (int argc, char *argv[]) {
continue
;
}
if
(
strcmp
(
arg
,
"--keysize"
)
==
0
)
{
if
(
i
+
1
<
argc
)
{
i
++
;
keysize
=
atoi
(
argv
[
i
]);
}
continue
;
}
if
(
strcmp
(
arg
,
"--valsize"
)
==
0
)
{
if
(
i
+
1
<
argc
)
{
i
++
;
valsize
=
atoi
(
argv
[
i
]);
}
continue
;
}
usage
();
return
1
;
}
...
...
@@ -127,8 +145,11 @@ int main (int argc, char *argv[]) {
total_n_items
=
1LL
<<
22
;
// 1LL<<16
}
printf
(
"nodesize=%d
\n
"
,
nodesize
);
printf
(
"keysize=%d
\n
"
,
keysize
);
printf
(
"valsize=%d
\n
"
,
valsize
);
printf
(
"Serial and random insertions of %d per batch
\n
"
,
ITEMS_TO_INSERT_PER_ITERATION
);
setup
(
nodesize
);
setup
();
gettimeofday
(
&
t1
,
0
);
biginsert
(
total_n_items
,
&
t1
);
gettimeofday
(
&
t2
,
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