mirror of
git://erdgeist.org/opentracker
synced 2025-04-04 04:17:15 +08:00
After studying opentracker live data, I decided to radically reduce default allocation for vectors and making it grow faster instead: Most pools only had one or two peers, wasting 8*15 or 8*14 bytes.
This commit is contained in:
parent
870c995fbb
commit
daf79f694d
@ -45,9 +45,9 @@ typedef time_t ot_time;
|
|||||||
extern time_t g_now;
|
extern time_t g_now;
|
||||||
#define NOW (g_now/OT_POOLS_TIMEOUT)
|
#define NOW (g_now/OT_POOLS_TIMEOUT)
|
||||||
|
|
||||||
#define OT_VECTOR_MIN_MEMBERS 16
|
#define OT_VECTOR_MIN_MEMBERS 4
|
||||||
#define OT_VECTOR_GROW_RATIO 4
|
#define OT_VECTOR_GROW_RATIO 8
|
||||||
#define OT_VECTOR_SHRINK_THRESH 5
|
#define OT_VECTOR_SHRINK_THRESH 6
|
||||||
#define OT_VECTOR_SHRINK_RATIO 4
|
#define OT_VECTOR_SHRINK_RATIO 4
|
||||||
typedef struct {
|
typedef struct {
|
||||||
void *data;
|
void *data;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user