Mercurial > hg > nginx
diff src/event/ngx_event_timer.h @ 304:bcbe876f4262
nginx-0.0.3-2004-04-02-09:14:40 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 02 Apr 2004 05:14:40 +0000 |
parents | 00c5660d2707 |
children | 39b6f2df45c0 |
line wrap: on
line diff
--- a/src/event/ngx_event_timer.h +++ b/src/event/ngx_event_timer.h @@ -77,7 +77,14 @@ ngx_inline static void ngx_event_add_tim #endif if (ev->timer_set) { - if (key - ev->rbtree_key < 50) { + + /* + * Use the previous timer value if a difference between them is less + * then 100 milliseconds. It allows to minimize the rbtree operations + * for the fast connections. + */ + + if (key - ev->rbtree_key < 100 / NGX_TIMER_RESOLUTION) { ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0, "event timer: %d, old: %d, new: %d", ngx_event_ident(ev->data), ev->rbtree_key, key);