diff options
-rw-r--r-- | Changes | 8 | ||||
-rw-r--r-- | ev.c | 3 |
2 files changed, 7 insertions, 4 deletions
@@ -1,8 +1,10 @@ Revision history for libev, a high-performance and full-featured event loop. - - use 1-based heaps, simplifies code, reduces codesize, makes - for better cache-efficiency and increases memory requirements - by up to two pointers/loop. + - use 1-based 2-heap for EV_MINIMAL, simplifies code, reduces + codesize and makes for better cache-efficiency. + - use 3-based 4-heap for !EV_MINIMAL. this makes better use + of cpu cache lines and gives better growth behaviour than + 2-based heaps. - fix a potential aliasing issue in ev_timer_again. - add/document ev_periodic_at, retract direct access to ->at. - improve ev_stat docs. @@ -810,6 +810,7 @@ downheap (WT *heap, int N, int k) // find minimum child if (expect_true (pos +3 < E)) { + /* fast path */ (minpos = pos + 0), (minat = (*minpos)->at); if (pos [1]->at < minat) (minpos = pos + 1), (minat = (*minpos)->at); if (pos [2]->at < minat) (minpos = pos + 2), (minat = (*minpos)->at); @@ -817,9 +818,9 @@ downheap (WT *heap, int N, int k) } else { + /* slow path */ if (pos >= E) break; - (minpos = pos + 0), (minat = (*minpos)->at); if (pos + 1 < E && pos [1]->at < minat) (minpos = pos + 1), (minat = (*minpos)->at); if (pos + 2 < E && pos [2]->at < minat) (minpos = pos + 2), (minat = (*minpos)->at); |