diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-02 20:39:26 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-02 20:39:26 +0100 |
| commit | 8f520e52d7d4081a0835374c7a448116baac64ab (patch) | |
| tree | fdb3c2e8d49aa8c94d6fff357ef2d18f3e0e553c /trackerlogic.h | |
| parent | 7419a9524754dfc4222de2c4e4c22808b571477d (diff) | |
Turn the bucket count into a knob, but keep cleaner wake-ups at a constant rate
Diffstat (limited to 'trackerlogic.h')
| -rw-r--r-- | trackerlogic.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/trackerlogic.h b/trackerlogic.h index 338e4e6..7292d36 100644 --- a/trackerlogic.h +++ b/trackerlogic.h | |||
| @@ -62,7 +62,12 @@ typedef struct { | |||
| 62 | 62 | ||
| 63 | /* We maintain a list of 1024 pointers to sorted list of ot_torrent structs | 63 | /* We maintain a list of 1024 pointers to sorted list of ot_torrent structs |
| 64 | Sort key is, of course, its hash */ | 64 | Sort key is, of course, its hash */ |
| 65 | /* Set from the Makefile, 8 to 16. More buckets means shorter vectors and a | ||
| 66 | cheaper insert, which only pays for a tracker carrying millions of | ||
| 67 | torrents; see DESIGN. */ | ||
| 68 | #ifndef OT_BUCKET_COUNT_BITS | ||
| 65 | #define OT_BUCKET_COUNT_BITS 10 | 69 | #define OT_BUCKET_COUNT_BITS 10 |
| 70 | #endif | ||
| 66 | 71 | ||
| 67 | #define OT_BUCKET_COUNT (1 << OT_BUCKET_COUNT_BITS) | 72 | #define OT_BUCKET_COUNT (1 << OT_BUCKET_COUNT_BITS) |
| 68 | #define OT_BUCKET_COUNT_SHIFT (32 - OT_BUCKET_COUNT_BITS) | 73 | #define OT_BUCKET_COUNT_SHIFT (32 - OT_BUCKET_COUNT_BITS) |
