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
01658181
Commit
01658181
authored
Oct 15, 2007
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add --nodesize cmd line parameter
git-svn-id:
file:///svn/tokudb@467
c7de825b-a66e-492c-adef-691d508d4ae1
parent
903b53fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
7 deletions
+32
-7
newbrt/benchmark-test.c
newbrt/benchmark-test.c
+32
-7
No files found.
newbrt/benchmark-test.c
View file @
01658181
...
...
@@ -21,11 +21,12 @@ enum { NODE_SIZE = 1<<20 };
CACHETABLE
ct
;
BRT
t
;
void
setup
(
void
)
{
void
setup
(
int
nodesize
)
{
printf
(
"nodesize=%d
\n
"
,
nodesize
);
int
r
;
unlink
(
fname
);
r
=
brt_create_cachetable
(
&
ct
,
0
);
assert
(
r
==
0
);
r
=
open_brt
(
fname
,
0
,
1
,
&
t
,
NODE_SIZE
,
ct
,
default_compare_fun
);
assert
(
r
==
0
);
r
=
open_brt
(
fname
,
0
,
1
,
&
t
,
nodesize
,
ct
,
default_compare_fun
);
assert
(
r
==
0
);
}
void
shutdown
(
void
)
{
...
...
@@ -87,23 +88,47 @@ void biginsert (long long n_elements, struct timeval *starttime) {
}
}
void
usage
()
{
printf
(
"benchmark-test [--nodesize NODESIZE] [TOTALITEMS]
\n
"
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
/* set defaults */
int
nodesize
=
NODE_SIZE
;
/* parse parameters */
int
i
;
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
char
*
arg
=
argv
[
i
];
if
(
arg
[
0
]
!=
'-'
)
break
;
if
(
strcmp
(
arg
,
"--nodesize"
)
==
0
)
{
if
(
i
+
1
<
argc
)
{
i
++
;
nodesize
=
atoi
(
argv
[
i
]);
}
continue
;
}
usage
();
return
1
;
}
struct
timeval
t1
,
t2
,
t3
;
long
long
total_n_items
;
if
(
argc
==
2
)
{
if
(
i
<
argc
)
{
char
*
end
;
errno
=
0
;
total_n_items
=
ITEMS_TO_INSERT_PER_ITERATION
*
(
long
long
)
strtol
(
argv
[
1
],
&
end
,
10
);
total_n_items
=
ITEMS_TO_INSERT_PER_ITERATION
*
(
long
long
)
strtol
(
argv
[
i
],
&
end
,
10
);
assert
(
errno
==
0
);
assert
(
*
end
==
0
);
assert
(
end
!=
argv
[
1
]);
assert
(
end
!=
argv
[
i
]);
}
else
{
total_n_items
=
1LL
<<
22
;
// 1LL<<16
}
printf
(
"Serial and random insertions of %d per batch
\n
"
,
ITEMS_TO_INSERT_PER_ITERATION
);
setup
();
setup
(
nodesize
);
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