aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code
diff options
context:
space:
mode:
authorNick Barnes2002-07-04 17:04:19 +0100
committerNick Barnes2002-07-04 17:04:19 +0100
commit37ba75f488c9db18f48d689b873b5e5b47baf8a1 (patch)
tree31c25f5862e5a27740bb19d7f3a06b275f68f847 /mps/code
parent175b300c786312ee7310fb88e2f93c8cd7e00d28 (diff)
downloademacs-37ba75f488c9db18f48d689b873b5e5b47baf8a1.tar.gz
emacs-37ba75f488c9db18f48d689b873b5e5b47baf8a1.zip
Track total time.
Copied from Perforce Change: 30793 ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
-rw-r--r--mps/code/steptest.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mps/code/steptest.c b/mps/code/steptest.c
index eca90727625..671986c82d5 100644
--- a/mps/code/steptest.c
+++ b/mps/code/steptest.c
@@ -305,7 +305,8 @@ static void *test(void *arg, size_t s)
305 size_t live, condemned, not_condemned; 305 size_t live, condemned, not_condemned;
306 size_t messages; 306 size_t messages;
307 mps_word_t collections, old_collections; 307 mps_word_t collections, old_collections;
308 double total_mps_time; 308 double total_mps_time, total_time;
309 double t1;
309 310
310 arena = (mps_arena_t)arg; 311 arena = (mps_arena_t)arg;
311 (void)s; /* unused */ 312 (void)s; /* unused */
@@ -350,6 +351,8 @@ static void *test(void *arg, size_t s)
350 total_clock_time = 0.0; 351 total_clock_time = 0.0;
351 collections = old_collections = 0; 352 collections = old_collections = 0;
352 353
354 t1 = my_clock();
355
353 while(objs < objCOUNT) { 356 while(objs < objCOUNT) {
354 size_t r; 357 size_t r;
355 358
@@ -385,6 +388,8 @@ static void *test(void *arg, size_t s)
385 } 388 }
386 } 389 }
387 390
391 total_time = time_since(t1) - total_clock_time;
392
388 if (collections > 0) 393 if (collections > 0)
389 printf("\n"); 394 printf("\n");
390 395
@@ -454,8 +459,10 @@ static void *test(void *arg, size_t s)
454 print_time("(", step_time / collections, ") per collection.\n"); 459 print_time("(", step_time / collections, ") per collection.\n");
455 } 460 }
456 } 461 }
462 print_time(" Total time ", total_time, ".\n");
457 print_time(" Total MPS time ", total_mps_time, ""); 463 print_time(" Total MPS time ", total_mps_time, "");
458 print_time(" (", total_mps_time/alloc_bytes, " per byte, "); 464 printf(" (%5.2f%%, ", total_mps_time * 100.0 / total_time);
465 print_time("", total_mps_time/alloc_bytes, " per byte, ");
459 print_time("", total_mps_time/objs, " per object)\n"); 466 print_time("", total_mps_time/objs, " per object)\n");
460 print_time(" (adjusted for clock timing: ", 467 print_time(" (adjusted for clock timing: ",
461 total_clock_time, 468 total_clock_time,