racket/collects/meta/zo-size.rkt
Robby Findler 4da6b0904e add something that tracks the size of .zo files over time
(this is for our benefit via drdr)
2013-04-09 22:02:49 -05:00

24 lines
865 B
Racket

#lang racket
(define ht (make-hash))
(for ([lcp (current-library-collection-paths)])
(when (directory-exists? lcp)
(for ([coll (in-list (directory-list lcp))])
(define coll-path (build-path lcp coll))
(when (directory-exists? coll-path)
(hash-set! ht
(path->string coll)
(for/sum ([file (in-directory (build-path lcp coll))]
#:when (regexp-match? #rx"[.]zo$" (path->string file)))
(file-size file)))))))
(define total (for/sum ([(k v) (in-hash ht)]) v))
(printf "The 'time' line is to trick drdr into graphing\n")
(printf "the size of all of the .zo files, in bytes\n")
(printf "cpu time: ~a real time: ~a gc time: ~a\n" total total total)
(printf "This is the breakdown by collection\n")
(sort (hash-map ht list)
string<=?
#:key car)