Skip to content

Fix incorrect DROP_SIZE usage #296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions dudect/constant.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ bool measure(int64_t *before_ticks,

switch (mode) {
case DUT(insert_head):
for (size_t i = DROP_SIZE; i < N_MEASURES - DROP_SIZE; i++) {
for (size_t i = 0; i < N_MEASURES; i++) {
char *s = get_random_string();
dut_new();
dut_insert_head(
Expand All @@ -94,7 +94,7 @@ bool measure(int64_t *before_ticks,
}
break;
case DUT(insert_tail):
for (size_t i = DROP_SIZE; i < N_MEASURES - DROP_SIZE; i++) {
for (size_t i = 0; i < N_MEASURES; i++) {
char *s = get_random_string();
dut_new();
dut_insert_head(
Expand All @@ -111,7 +111,7 @@ bool measure(int64_t *before_ticks,
}
break;
case DUT(remove_head):
for (size_t i = DROP_SIZE; i < N_MEASURES - DROP_SIZE; i++) {
for (size_t i = 0; i < N_MEASURES; i++) {
dut_new();
dut_insert_head(
get_random_string(),
Expand All @@ -129,7 +129,7 @@ bool measure(int64_t *before_ticks,
}
break;
case DUT(remove_tail):
for (size_t i = DROP_SIZE; i < N_MEASURES - DROP_SIZE; i++) {
for (size_t i = 0; i < N_MEASURES; i++) {
dut_new();
dut_insert_head(
get_random_string(),
Expand All @@ -147,7 +147,7 @@ bool measure(int64_t *before_ticks,
}
break;
default:
for (size_t i = DROP_SIZE; i < N_MEASURES - DROP_SIZE; i++) {
for (size_t i = 0; i < N_MEASURES; i++) {
dut_new();
dut_insert_head(
get_random_string(),
Expand Down
2 changes: 1 addition & 1 deletion dudect/fixture.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static void update_statistics(const int64_t *exec_times,
uint8_t *classes,
int64_t *percentiles)
{
for (size_t i = 0; i < N_MEASURES; i++) {
for (size_t i = DROP_SIZE; i < N_MEASURES - DROP_SIZE; i++) {
int64_t difference = exec_times[i];
/* CPU cycle counter overflowed or dropped measurement */
if (difference <= 0)
Expand Down
Loading