|
341 | 341 | (define count-i 0.0) |
342 | 342 | (define total-u 0.0) |
343 | 343 | (define count-u 0.0) |
| 344 | + (define total-mem-bytes 0) |
344 | 345 |
|
345 | 346 | (define timeline |
346 | 347 | (make-hash ; this hash is to be used for the plots |
|
360 | 361 | (when test-id |
361 | 362 | (pretty-print (map read-from-string (hash-ref rec 'exprs)))) |
362 | 363 |
|
| 364 | + (define mem-before (current-memory-use 'cumulative)) |
363 | 365 | (match-define (list c-time v-num v-time i-num i-time u-num u-time rival-baseline-diff) |
364 | 366 | (time-exprs (time-expr rec timeline sollya-reeval))) |
| 367 | + (define mem-after (current-memory-use 'cumulative)) |
| 368 | + (define mem-delta (- mem-after mem-before)) |
| 369 | + (define mem-mib (/ (exact->inexact mem-delta) (* 1024 1024))) |
365 | 370 | (set! total-c (+ total-c c-time)) |
366 | 371 | (set! total-v (+ total-v v-time)) |
367 | 372 | (set! count-v (+ count-v v-num)) |
368 | 373 | (set! total-i (+ total-i i-time)) |
369 | 374 | (set! count-i (+ count-i i-num)) |
370 | 375 | (set! total-u (+ total-u u-time)) |
371 | 376 | (set! count-u (+ count-u u-num)) |
| 377 | + (set! total-mem-bytes (+ total-mem-bytes mem-delta)) |
372 | 378 | (define t-time (+ c-time v-time i-time u-time)) |
373 | | - (printf "~a: ~as ~as ~as ~as\n" |
| 379 | + (printf "~a: ~as ~as ~as ~as ~as MiB\n" |
374 | 380 | (~a i #:align 'left #:min-width 3) |
375 | 381 | (~r t-time #:precision '(= 3) #:min-width 8) |
376 | 382 | (~r v-time #:precision '(= 3) #:min-width 8) |
377 | 383 | (~r i-time #:precision '(= 3) #:min-width 8) |
378 | | - (~r u-time #:precision '(= 3) #:min-width 8)) |
379 | | - (list i t-time c-time v-num v-time i-num i-time u-num u-time rival-baseline-diff))) |
| 384 | + (~r u-time #:precision '(= 3) #:min-width 8) |
| 385 | + (~r mem-mib #:precision '(= 3) #:min-width 8)) |
| 386 | + (list i t-time c-time v-num v-time i-num i-time u-num u-time mem-mib rival-baseline-diff))) |
380 | 387 | (printf "\nDATA:\n") |
381 | 388 | (printf "\tNUMBER OF TUNED BENCHMARKS = ~a\n" (*num-tuned-benchmarks*)) |
382 | 389 | (printf "\tRIVAL TIMEOUTS = ~a\n" (*rival-timeout*)) |
|
388 | 395 | (close-output-port timeline-port)) |
389 | 396 |
|
390 | 397 | (define total-t (+ total-c total-v total-i total-u)) |
| 398 | + (define total-mem (/ (exact->inexact total-mem-bytes) (* 1024 1024))) |
391 | 399 | (printf "\nTotal Time: ~as\n" (~r total-t #:precision '(= 3))) |
392 | | - (define footer (list "Total" total-t total-c count-v total-v count-i total-i count-u total-u)) |
| 400 | + (printf "Total Memory: ~a MiB\n" |
| 401 | + (~r total-mem #:precision '(= 3))) |
| 402 | + (define footer (list "Total" total-t total-c count-v total-v count-i total-i count-u total-u total-mem)) |
393 | 403 | (values table footer)) |
394 | 404 |
|
395 | 405 | (define (html-write port) |
|
485 | 495 | ("(s)" "s") |
486 | 496 | "Unable" |
487 | 497 | ("(s)" "s") |
| 498 | + ("Memory" "MiB") |
488 | 499 | "Baseline-valid, Rival-exit")) |
489 | 500 | (html-write-table html-port "Expression timing" cols) |
490 | 501 | (for ([row (in-list expression-table)]) |
|
0 commit comments