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
32ae76dc
Commit
32ae76dc
authored
Mar 01, 2008
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add --norandom
git-svn-id:
file:///svn/tokudb@2483
c7de825b-a66e-492c-adef-691d508d4ae1
parent
80679feb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
db-benchmark-test/db-benchmark-test.c
db-benchmark-test/db-benchmark-test.c
+14
-4
No files found.
db-benchmark-test/db-benchmark-test.c
View file @
32ae76dc
...
...
@@ -29,6 +29,7 @@ int pagesize = 0;
long
long
cachesize
=
128
*
1024
*
1024
;
int
dupflags
=
0
;
int
noserial
=
0
;
// Don't do the serial stuff
int
norandom
=
0
;
// Don't do the random stuff
int
items_per_transaction
=
DEFAULT_ITEMS_PER_TRANSACTION
;
int
items_per_iteration
=
DEFAULT_ITEMS_TO_INSERT_PER_ITERATION
;
...
...
@@ -201,11 +202,13 @@ void biginsert (long long n_elements, struct timeval *starttime) {
printf
(
"serial %9.6fs %8.0f/s "
,
tdiff
(
&
t2
,
&
t1
),
items_per_iteration
/
tdiff
(
&
t2
,
&
t1
));
fflush
(
stdout
);
}
if
(
!
norandom
)
{
gettimeofday
(
&
t1
,
0
);
random_insert_below
((
i
+
items_per_iteration
)
*
SERIAL_SPACING
);
gettimeofday
(
&
t2
,
0
);
printf
(
"random %9.6fs %8.0f/s "
,
tdiff
(
&
t2
,
&
t1
),
items_per_iteration
/
tdiff
(
&
t2
,
&
t1
));
printf
(
"cumulative %9.6fs %8.0f/s
\n
"
,
tdiff
(
&
t2
,
starttime
),
(
items_per_iteration
*
2
.
0
/
tdiff
(
&
t2
,
starttime
))
*
(
iteration
+
1
));
}
printf
(
"cumulative %9.6fs %8.0f/s
\n
"
,
tdiff
(
&
t2
,
starttime
),
(((
float
)
items_per_iteration
*
(
!
noserial
+!
norandom
))
/
tdiff
(
&
t2
,
starttime
))
*
(
iteration
+
1
));
}
}
...
...
@@ -246,6 +249,10 @@ int main (int argc, const char *argv[]) {
noserial
=
1
;
continue
;
}
if
(
strcmp
(
arg
,
"--norandom"
)
==
0
)
{
norandom
=
1
;
continue
;
}
if
(
strcmp
(
arg
,
"--xcount"
)
==
0
)
{
if
(
i
+
1
>=
argc
)
return
print_usage
(
argv
[
0
]);
items_per_transaction
=
strtoll
(
argv
[
++
i
],
0
,
10
);
...
...
@@ -293,8 +300,10 @@ int main (int argc, const char *argv[]) {
}
total_n_items
=
items_per_iteration
*
(
long
long
)
n_iterations
;
}
if
(
!
noserial
)
printf
(
"serial and "
);
printf
(
"random insertions of %d per batch%s
\n
"
,
items_per_iteration
,
do_transactions
?
" (with transactions)"
:
""
);
if
(
!
noserial
)
printf
(
"serial "
);
if
(
!
noserial
&&
!
norandom
)
printf
(
"and "
);
if
(
!
norandom
)
printf
(
"random "
);
printf
(
"insertions of %d per batch%s
\n
"
,
items_per_iteration
,
do_transactions
?
" (with transactions)"
:
""
);
setup
();
gettimeofday
(
&
t1
,
0
);
biginsert
(
total_n_items
,
&
t1
);
...
...
@@ -302,7 +311,8 @@ int main (int argc, const char *argv[]) {
shutdown
();
gettimeofday
(
&
t3
,
0
);
printf
(
"Shutdown %9.6fs
\n
"
,
tdiff
(
&
t3
,
&
t2
));
printf
(
"Total time %9.6fs for %lld insertions = %8.0f/s
\n
"
,
tdiff
(
&
t3
,
&
t1
),
2
*
total_n_items
,
2
*
total_n_items
/
tdiff
(
&
t3
,
&
t1
));
printf
(
"Total time %9.6fs for %lld insertions = %8.0f/s
\n
"
,
tdiff
(
&
t3
,
&
t1
),
(
!
noserial
+!
norandom
)
*
total_n_items
,
(
!
noserial
+!
norandom
)
*
total_n_items
/
tdiff
(
&
t3
,
&
t1
));
return
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