Skip to content

Commit

Permalink
Don't flush on every time a string is posted to the log. That has
Browse files Browse the repository at this point in the history
a substantial impact on performance.  Move the fflush so it flushes
after every track/side read.
  • Loading branch information
qbarnes committed Dec 11, 2021
1 parent 27739de commit 296d161
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cw2dmk.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ msg(int level, const char *fmt, ...)
va_start(args, fmt);
vfprintf(out_file, fmt, args);
va_end(args);
fflush(out_file);
}
}

Expand Down Expand Up @@ -2294,6 +2293,7 @@ main(int argc, char** argv)

total_retries += retry;
fflush(stdout);
if (out_file) fflush(out_file);
if (accum_sectors) {
short *idam_p = (short *)dmk_track;
int i;
Expand Down

1 comment on commit 296d161

@TimothyPMann
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great.

Please sign in to comment.