Skip to content

Commit

Permalink
Increase checksum buffer to 128kb
Browse files Browse the repository at this point in the history
Reading 2kb at a time to compute the checksum limits network throughput.
Bumping up to 128kb seems to give a good balance of memory usage and
performance.

Benchmarks done on a m5n.16xlarge EC2 instance doing a reposync on the
Amazon Linux 2023 x86-64 repositories showed that this change, when
combined with the (smaller) benefits of my avoiding libc IO patch,
reduce system CPU time by another half second, and cut a further 3
seconds off total time:

102s (original) -> 99 (no libc buffered io) -> 95s (this patch)
  • Loading branch information
stewartsmith committed Feb 9, 2024
1 parent ae727d9 commit 89e0522
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion librepo/checksum.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "util.h"
#include "xattr_internal.h"

#define BUFFER_SIZE 2048
#define BUFFER_SIZE 128*1024
#define MAX_CHECKSUM_NAME_LEN 7

LrChecksumType
Expand Down

0 comments on commit 89e0522

Please sign in to comment.