Replace the red-black tree with a heap. The most common operation that libuv performs on timers is looking up the first timer to expire. With a red-black tree, that operation is O(log n). With a heap, it's O(1).