]> git.ozlabs.org Git - ccan/commitdiff
timer: increase default span to 5.
authorRusty Russell <rusty@rustcorp.com.au>
Fri, 5 Apr 2013 06:13:49 +0000 (16:43 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 5 Apr 2013 06:21:08 +0000 (16:51 +1030)
There's a sweet spot around 5, without going all the way to 13 (which
would make each level 64/128k large).

TIMER_LEVEL_BITS 2: 100000000 in 5.833399-5.884659(5.85912+/-0.015) (18 levels / 32)
TIMER_LEVEL_BITS 3: 100000000 in 5.267610-5.303589(5.29018+/-0.011) (12-13(12.5+/-0.5) levels / 22)
TIMER_LEVEL_BITS 4: 100000000 in 4.215605-4.417297(4.27771+/-0.062) (9-10(9.1+/-0.3) levels / 16)
TIMER_LEVEL_BITS 5: 100000000 in 3.859340-3.972603(3.90149+/-0.034) (7-8(7.1+/-0.3) levels / 13)
TIMER_LEVEL_BITS 6: 100000000 in 3.976157-4.037230(4.00199+/-0.02) (6 levels / 11)
TIMER_LEVEL_BITS 7: 100000000 in 4.014228-4.082031(4.05024+/-0.022) (5-6(5.4+/-0.49) levels / 10)
TIMER_LEVEL_BITS 8: 100000000 in 3.915615-3.978781(3.94972+/-0.02) (5 levels / 8)
TIMER_LEVEL_BITS 9: 100000000 in 3.859413-4.025842(3.89993+/-0.046) (4-5(4.6+/-0.49) levels / 8)
TIMER_LEVEL_BITS 10: 100000000 in 3.983507-4.170152(4.06743+/-0.055) (4 levels / 7)
TIMER_LEVEL_BITS 11: 100000000 in 3.468756-3.610746(3.52843+/-0.04) (4 levels / 6)
TIMER_LEVEL_BITS 12: 100000000 in 3.274397-3.377530(3.3192+/-0.026) (4 levels / 6)
TIMER_LEVEL_BITS 13: 100000000 in 3.116845-3.178162(3.1398+/-0.017) (3 levels / 5)
TIMER_LEVEL_BITS 14: 100000000 in 3.152599-3.264060(3.20733+/-0.043) (3 levels / 5)
TIMER_LEVEL_BITS 15: 100000000 in 3.186556-3.552432(3.25597+/-0.11) (3 levels / 5)
TIMER_LEVEL_BITS 16: 100000000 in 3.139352-3.485653(3.27263+/-0.11) (3 levels / 4)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/timer/timer.h

index 3bf28d0fbda2cdd8f4e3396bc19928d2b1ac7960..65f849b3dccc22743ed958a6d36ddb04370c2b65 100644 (file)
@@ -5,10 +5,15 @@
 #include <ccan/list/list.h>
 #include <stdint.h>
 
 #include <ccan/list/list.h>
 #include <stdint.h>
 
+#ifndef TIMER_GRANULARITY
 /* We divide all nsec values by 1000, reducing it to usec granularity. */
 #define TIMER_GRANULARITY 1000
 /* We divide all nsec values by 1000, reducing it to usec granularity. */
 #define TIMER_GRANULARITY 1000
-/* This gives 16 pointers per level, up to 13 levels deep. */
-#define TIMER_LEVEL_BITS 4
+#endif
+
+#ifndef TIMER_LEVEL_BITS
+/* This gives 32 pointers per level, up to 13 levels deep. */
+#define TIMER_LEVEL_BITS 5
+#endif
 
 struct timers;
 struct timer;
 
 struct timers;
 struct timer;