Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
6287fdff
Commit
6287fdff
authored
Apr 08, 2013
by
Michal 'vorner' Vaner
Browse files
[2871] Tweak the times and iteration counts
So even the naive approach terminates some day.
parent
6700ecd5
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bin/resolver/bench/fake_resolution.cc
View file @
6287fdff
...
...
@@ -28,11 +28,11 @@ namespace bench {
// Parameters of the generated queries.
// How much work is each operation?
const
size_t
parse_size
=
100000
00
;
const
size_t
render_size
=
100000
00
;
const
size_t
send_size
=
1000
00
;
const
size_t
cache_read_size
=
10000
00
;
const
size_t
cache_write_size
=
10000
00
;
const
size_t
parse_size
=
100000
;
const
size_t
render_size
=
100000
;
const
size_t
send_size
=
1000
;
const
size_t
cache_read_size
=
10000
;
const
size_t
cache_write_size
=
10000
;
// How large a change is to terminate in this iteration (either by getting
// the complete answer, or by finding it in the cache). With 0.5, half the
// queries are found in the cache directly. Half of the rest needs just one
...
...
@@ -41,7 +41,7 @@ const float chance_complete = 0.5;
// Number of milliseconds an upstream query can take. It picks a random number
// in between.
const
size_t
upstream_time_min
=
2
;
const
size_t
upstream_time_max
=
3
0
;
const
size_t
upstream_time_max
=
5
0
;
FakeQuery
::
FakeQuery
(
FakeInterface
&
interface
)
:
interface_
(
&
interface
),
...
...
@@ -52,7 +52,7 @@ FakeQuery::FakeQuery(FakeInterface& interface) :
steps_
.
push_back
(
Step
(
Compute
,
parse_size
));
// Look into the cache if it is there
steps_
.
push_back
(
Step
(
CacheRead
,
cache_read_size
));
while
(
1.0
*
random
()
/
RAND_MAX
>
chance_complete
)
{
while
(
(
1.0
*
random
()
)
/
RAND_MAX
>
chance_complete
)
{
// Needs another step of recursion. Render the upstream query.
steps_
.
push_back
(
Step
(
Compute
,
render_size
));
// Send it and wait for the answer.
...
...
src/bin/resolver/bench/main.cc
View file @
6287fdff
...
...
@@ -16,12 +16,12 @@
#include <bench/benchmark.h>
const
size_t
count
=
1000
00
;
// TODO: We may want to read this from argv.
const
size_t
count
=
1000
;
// TODO: We may want to read this from argv.
int
main
(
int
,
const
char
**
)
{
// Run the naive implementation
isc
::
resolver
::
bench
::
NaiveResolver
naive_resolver
(
count
);
isc
::
bench
::
BenchMark
<
isc
::
resolver
::
bench
::
NaiveResolver
>
(
count
,
naive_resolver
,
true
);
(
1
,
naive_resolver
,
true
);
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