]> git.ozlabs.org Git - ccan/commitdiff
alloc: reduce number of large pages to 256.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 28 Jul 2010 13:40:58 +0000 (23:10 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 28 Jul 2010 13:40:58 +0000 (23:10 +0930)
This reduces the number of huge allocs, which drops test time from 6 minutes to 57 seconds.

ccan/alloc/alloc.c
ccan/alloc/test/run.c

index 693943aea140c881587020550525c1aa78571768..b4235d0ef404b3fba2c7e3738a89832ad4be4286 100644 (file)
@@ -35,7 +35,7 @@
  */
 
 /* We divide the pool into this many large pages (nearest power of 2) */
  */
 
 /* We divide the pool into this many large pages (nearest power of 2) */
-#define MAX_LARGE_PAGES (1024UL)
+#define MAX_LARGE_PAGES (256UL)
 
 /* 32 small pages == 1 large page. */
 #define BITS_FROM_SMALL_TO_LARGE_PAGE 5
 
 /* 32 small pages == 1 large page. */
 #define BITS_FROM_SMALL_TO_LARGE_PAGE 5
index e75eddbffe4fabe8b45cd3f6e7f85ef6bc2e17a5..a6d021ff9e5dc87b3d1f25cf821fc15215031208 100644 (file)
@@ -164,7 +164,7 @@ static void test(unsigned int pool_size)
 
 int main(int argc, char *argv[])
 {
 
 int main(int argc, char *argv[])
 {
-       plan_tests(480);
+       plan_tests(440);
 
        /* Large test. */
        test(MIN_USEFUL_SIZE * 2);
 
        /* Large test. */
        test(MIN_USEFUL_SIZE * 2);