From 8f520e52d7d4081a0835374c7a448116baac64ab Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Mon, 2 Nov 2026 20:39:26 +0100 Subject: Turn the bucket count into a knob, but keep cleaner wake-ups at a constant rate --- trackerlogic.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'trackerlogic.h') diff --git a/trackerlogic.h b/trackerlogic.h index 338e4e6..7292d36 100644 --- a/trackerlogic.h +++ b/trackerlogic.h @@ -62,7 +62,12 @@ typedef struct { /* We maintain a list of 1024 pointers to sorted list of ot_torrent structs Sort key is, of course, its hash */ +/* Set from the Makefile, 8 to 16. More buckets means shorter vectors and a + cheaper insert, which only pays for a tracker carrying millions of + torrents; see DESIGN. */ +#ifndef OT_BUCKET_COUNT_BITS #define OT_BUCKET_COUNT_BITS 10 +#endif #define OT_BUCKET_COUNT (1 << OT_BUCKET_COUNT_BITS) #define OT_BUCKET_COUNT_SHIFT (32 - OT_BUCKET_COUNT_BITS) -- cgit v1.3