mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-09 20:41:27 -04:00
Increase MIN_BUFFER_SIZE to 512 (1024 on 64-bit)
This constant decides the smallest (and typical) size of each evbuffer chain. Since this number includes sizeof(evbuffer_chain) overhead, the old value (256) was just too low: on 64-bit platforms, it would spend nearly 20% of the allocations on overhead. The new values mean that we'll be spending closer to 5% of evbuffer allocations on overhead. It would be nice to get this number even lower if we can.
This commit is contained in:
parent
6f20492fa2
commit
2014ae4ac6
@ -45,8 +45,15 @@ extern "C" {
|
|||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
/* minimum allocation for a chain. */
|
|
||||||
#define MIN_BUFFER_SIZE 256
|
/* Minimum allocation for a chain. We define this so that we're burning no
|
||||||
|
* more than 5% of each allocation on overhead. It would be nice to lose even
|
||||||
|
* less space, though. */
|
||||||
|
#if _EVENT_SIZEOF_VOID_P < 8
|
||||||
|
#define MIN_BUFFER_SIZE 512
|
||||||
|
#else
|
||||||
|
#define MIN_BUFFER_SIZE 1024
|
||||||
|
#endif
|
||||||
|
|
||||||
/** A single evbuffer callback for an evbuffer. This function will be invoked
|
/** A single evbuffer callback for an evbuffer. This function will be invoked
|
||||||
* when bytes are added to or removed from the evbuffer. */
|
* when bytes are added to or removed from the evbuffer. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user