From 367ae766143b088eb2287fca00209d2b506b3b09 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Mon, 12 May 2014 12:53:46 +0100 Subject: [PATCH] Park the arena before calling mps_chain_destroy. Speed up mpsicv by reducing number of objects and by only running the test once (there's no inlined mps_tramp any more). Copied from Perforce Change: 186024 ServerID: perforce.ravenbrook.com --- mps/code/expt825.c | 1 + mps/code/finalcv.c | 1 + mps/code/finaltest.c | 1 + mps/code/gcbench.c | 1 + mps/code/mpsicv.c | 5 +++-- mps/code/steptest.c | 2 ++ mps/code/walkt0.c | 3 +++ mps/code/zcoll.c | 1 + mps/code/zmess.c | 1 + 9 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mps/code/expt825.c b/mps/code/expt825.c index 5e775455909..bd6c5f2b1e0 100644 --- a/mps/code/expt825.c +++ b/mps/code/expt825.c @@ -250,6 +250,7 @@ static void *test(void *arg, size_t s) (ulongest_t)object_count); } + mps_arena_park(arena); mps_ap_destroy(ap); mps_root_destroy(mps_root); mps_pool_destroy(amc); diff --git a/mps/code/finalcv.c b/mps/code/finalcv.c index 1466e514ff8..931503cf9bb 100644 --- a/mps/code/finalcv.c +++ b/mps/code/finalcv.c @@ -199,6 +199,7 @@ static void *test(void *arg, size_t s) /* @@@@ missing */ + mps_arena_park(arena); mps_ap_destroy(ap); mps_root_destroy(mps_root[1]); mps_root_destroy(mps_root[0]); diff --git a/mps/code/finaltest.c b/mps/code/finaltest.c index f449d7e1acf..a34dccec3be 100644 --- a/mps/code/finaltest.c +++ b/mps/code/finaltest.c @@ -284,6 +284,7 @@ int main(int argc, char *argv[]) test_mode(ModePOLL, arena, chain); test_mode(ModePARK, arena, NULL); + mps_arena_park(arena); mps_chain_destroy(chain); mps_thread_dereg(thread); mps_arena_destroy(arena); diff --git a/mps/code/gcbench.c b/mps/code/gcbench.c index 2a18d1a7d10..c958128ce4f 100644 --- a/mps/code/gcbench.c +++ b/mps/code/gcbench.c @@ -243,6 +243,7 @@ static void arena_setup(gcthread_fn_t fn, RESMUST(mps_pool_create_k(&pool, arena, pool_class, args)); } MPS_ARGS_END(args); watch(fn, name); + mps_arena_park(arena); mps_pool_destroy(pool); mps_fmt_destroy(format); if (ngen > 0) diff --git a/mps/code/mpsicv.c b/mps/code/mpsicv.c index 55396aee3fe..6a241561a22 100644 --- a/mps/code/mpsicv.c +++ b/mps/code/mpsicv.c @@ -21,7 +21,7 @@ #define exactRootsCOUNT 49 #define ambigRootsCOUNT 49 -#define OBJECTS 200000 +#define OBJECTS 100000 #define patternFREQ 100 /* objNULL needs to be odd so that it's ignored in exactRoots. */ @@ -552,6 +552,8 @@ static void *test(void *arg, size_t s) mps_free(mv, alloced_obj, 32); alloc_v_test(mv); + + mps_arena_park(arena); mps_pool_destroy(mv); mps_ap_destroy(ap); mps_root_destroy(fmtRoot); @@ -589,7 +591,6 @@ int main(int argc, char *argv[]) marker, (size_t)0), "root_create_reg"); - (mps_tramp)(&r, test, arena, 0); /* non-inlined trampoline */ mps_tramp(&r, test, arena, 0); mps_root_destroy(reg_root); mps_thread_dereg(thread); diff --git a/mps/code/steptest.c b/mps/code/steptest.c index deee85fef2e..546eaa7e417 100644 --- a/mps/code/steptest.c +++ b/mps/code/steptest.c @@ -478,6 +478,8 @@ static void *test(void *arg, size_t s) printf(" %"PRIuLONGEST" clock reads; ", (ulongest_t)clock_reads); print_time("", total_clock_time / clock_reads, " per read;"); print_time(" recently measured as ", clock_time, ").\n"); + + mps_arena_park(arena); mps_ap_destroy(ap); mps_root_destroy(exactRoot); mps_root_destroy(ambigRoot); diff --git a/mps/code/walkt0.c b/mps/code/walkt0.c index 929408fc4b4..6b0002000d4 100644 --- a/mps/code/walkt0.c +++ b/mps/code/walkt0.c @@ -191,11 +191,14 @@ static void *test(mps_arena_t arena, mps_class_t pool_class) /* Note: stepper finds more than we expect, due to pad objects */ /* printf("stepper found %ld objs\n", sd->count); */ + + mps_arena_park(arena); mps_ap_destroy(ap); mps_root_destroy(exactRoot); mps_pool_destroy(pool); mps_chain_destroy(chain); mps_fmt_destroy(format); + mps_arena_release(arena); return NULL; } diff --git a/mps/code/zcoll.c b/mps/code/zcoll.c index 06ef499f5b7..220368f39d3 100644 --- a/mps/code/zcoll.c +++ b/mps/code/zcoll.c @@ -774,6 +774,7 @@ static void *testscriptB(void *arg, size_t s) testscriptC(arena, ap, script); printf(" Destroy roots, pools, arena etc.\n\n"); + mps_arena_park(arena); mps_root_destroy(root_stackreg); mps_ap_destroy(ap); mps_root_destroy(root_table_Exact); diff --git a/mps/code/zmess.c b/mps/code/zmess.c index 555e7377d2c..4cfaf9944f3 100644 --- a/mps/code/zmess.c +++ b/mps/code/zmess.c @@ -381,6 +381,7 @@ static void *testscriptB(void *arg, size_t s) testscriptC(arena, script); + mps_arena_park(arena); mps_ap_destroy(ap); mps_root_destroy(root_table); mps_pool_destroy(amc);