trying to figure out why the runtime behavior of compilation is so variable; I sometimes get 13.23 seconds, and sometimes 5.73 seconds, and I have no control over why. Really strange.
This commit is contained in:
parent
1a872c52d0
commit
69afabe3a6
|
@ -96,7 +96,7 @@
|
||||||
(call-with-input-file* path md5)))
|
(call-with-input-file* path md5)))
|
||||||
(cond
|
(cond
|
||||||
[maybe-row
|
[maybe-row
|
||||||
(gunzip-content (vector-ref maybe-row 2))]
|
(vector-ref maybe-row 2) #;(gunzip-content (vector-ref maybe-row 2))]
|
||||||
[else
|
[else
|
||||||
#f])]
|
#f])]
|
||||||
[else
|
[else
|
||||||
|
@ -116,7 +116,7 @@
|
||||||
(query-exec conn insert-cache-stmt
|
(query-exec conn insert-cache-stmt
|
||||||
(path->string path)
|
(path->string path)
|
||||||
signature
|
signature
|
||||||
(gzip-content data))]
|
data #;(gzip-content data))]
|
||||||
[else
|
[else
|
||||||
(error 'save-in-cache! "File ~e does not exist" path)]))
|
(error 'save-in-cache! "File ~e does not exist" path)]))
|
||||||
|
|
||||||
|
|
|
@ -369,8 +369,9 @@ M.modules[~s] =
|
||||||
;; Optimization: if we've seen this source before, we may be able to pull
|
;; Optimization: if we've seen this source before, we may be able to pull
|
||||||
;; it from the cache.
|
;; it from the cache.
|
||||||
(define (on-source src stmts op)
|
(define (on-source src stmts op)
|
||||||
|
|
||||||
(define (on-path path)
|
(define (on-path path)
|
||||||
|
(cond
|
||||||
|
[(current-with-cache?)
|
||||||
(cond
|
(cond
|
||||||
[(cached? path)
|
[(cached? path)
|
||||||
=>
|
=>
|
||||||
|
@ -379,12 +380,12 @@ M.modules[~s] =
|
||||||
[(cacheable? path)
|
[(cacheable? path)
|
||||||
(define string-op (open-output-bytes))
|
(define string-op (open-output-bytes))
|
||||||
(assemble/write-invoke (my-force stmts) string-op)
|
(assemble/write-invoke (my-force stmts) string-op)
|
||||||
(save-in-cache! path (open-output-bytes))
|
(save-in-cache! path (get-output-bytes string-op))
|
||||||
(display (get-output-string string-op) op)]
|
(display (get-output-string string-op) op)]
|
||||||
|
[else
|
||||||
|
(assemble/write-invoke (my-force stmts) op)])]
|
||||||
[else
|
[else
|
||||||
(assemble/write-invoke (my-force stmts) op)]))
|
(assemble/write-invoke (my-force stmts) op)]))
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
[(ModuleSource? src)
|
[(ModuleSource? src)
|
||||||
(on-path (ModuleSource-path src))]
|
(on-path (ModuleSource-path src))]
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
current-kernel-module-locator?
|
current-kernel-module-locator?
|
||||||
current-compress-javascript?
|
current-compress-javascript?
|
||||||
current-one-module-per-file?
|
current-one-module-per-file?
|
||||||
|
current-with-cache?
|
||||||
|
|
||||||
|
|
||||||
current-report-port
|
current-report-port
|
||||||
current-timing-port
|
current-timing-port
|
||||||
|
@ -82,6 +84,11 @@
|
||||||
(define current-one-module-per-file? (make-parameter #f))
|
(define current-one-module-per-file? (make-parameter #f))
|
||||||
|
|
||||||
|
|
||||||
|
;; Turns on caching of compiled programs, so that repeated compilations
|
||||||
|
;; will reuse existing work.
|
||||||
|
(: current-with-cache? (Parameterof Boolean))
|
||||||
|
(define current-with-cache? (make-parameter #t))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(: current-report-port (Parameterof Output-Port))
|
(: current-report-port (Parameterof Output-Port))
|
||||||
|
|
|
@ -6,4 +6,4 @@
|
||||||
|
|
||||||
(provide version)
|
(provide version)
|
||||||
(: version String)
|
(: version String)
|
||||||
(define version "1.19")
|
(define version "1.27")
|
||||||
|
|
|
@ -77,7 +77,8 @@
|
||||||
(call-with-output-file* (build-path (current-output-dir) output-filename)
|
(call-with-output-file* (build-path (current-output-dir) output-filename)
|
||||||
(lambda (op)
|
(lambda (op)
|
||||||
(package-standalone-xhtml
|
(package-standalone-xhtml
|
||||||
(make-MainModuleSource (build-path f))
|
(make-MainModuleSource
|
||||||
|
(normalize-path (build-path f)))
|
||||||
op))
|
op))
|
||||||
#:exists 'replace)))))
|
#:exists 'replace)))))
|
||||||
|
|
||||||
|
@ -140,7 +141,8 @@
|
||||||
(call-with-output-file* (make-output-js-filename)
|
(call-with-output-file* (make-output-js-filename)
|
||||||
(lambda (op)
|
(lambda (op)
|
||||||
(display (get-runtime) op)
|
(display (get-runtime) op)
|
||||||
(display (get-inert-code (make-MainModuleSource (build-path f))
|
(display (get-inert-code (make-MainModuleSource
|
||||||
|
(normalize-path (build-path f)))
|
||||||
make-output-js-filename)
|
make-output-js-filename)
|
||||||
op))
|
op))
|
||||||
#:exists 'replace)
|
#:exists 'replace)
|
||||||
|
@ -170,5 +172,6 @@
|
||||||
(define (get-javascript-code filename)
|
(define (get-javascript-code filename)
|
||||||
(turn-on-logger!)
|
(turn-on-logger!)
|
||||||
(display (get-standalone-code
|
(display (get-standalone-code
|
||||||
(make-MainModuleSource (build-path filename)))
|
(make-MainModuleSource
|
||||||
|
(normalize-path (build-path filename))))
|
||||||
(current-output-port)))
|
(current-output-port)))
|
||||||
|
|
|
@ -66,6 +66,9 @@
|
||||||
[("--enable-profiling")
|
[("--enable-profiling")
|
||||||
("Enable profiling to standard output")
|
("Enable profiling to standard output")
|
||||||
(with-profiling? #t)]
|
(with-profiling? #t)]
|
||||||
|
[("--without-cache")
|
||||||
|
("Turn off the internal compilation cache")
|
||||||
|
(current-with-cache? #f)]
|
||||||
[("--compress-javascript")
|
[("--compress-javascript")
|
||||||
("Compress JavaScript with Google Closure (requires Java)")
|
("Compress JavaScript with Google Closure (requires Java)")
|
||||||
(current-compress-javascript? #t)]
|
(current-compress-javascript? #t)]
|
||||||
|
@ -98,6 +101,9 @@
|
||||||
[("--enable-profiling")
|
[("--enable-profiling")
|
||||||
("Enable profiling to standard output")
|
("Enable profiling to standard output")
|
||||||
(with-profiling? #t)]
|
(with-profiling? #t)]
|
||||||
|
[("--without-cache")
|
||||||
|
("Turn off the internal compilation cache")
|
||||||
|
(current-with-cache? #f)]
|
||||||
[("--compress-javascript")
|
[("--compress-javascript")
|
||||||
("Compress JavaScript with Google Closure (requires Java)")
|
("Compress JavaScript with Google Closure (requires Java)")
|
||||||
(current-compress-javascript? #t)]
|
(current-compress-javascript? #t)]
|
||||||
|
@ -117,6 +123,9 @@
|
||||||
[("--enable-profiling")
|
[("--enable-profiling")
|
||||||
("Enable profiling to standard output")
|
("Enable profiling to standard output")
|
||||||
(with-profiling? #t)]
|
(with-profiling? #t)]
|
||||||
|
[("--without-cache")
|
||||||
|
("Turn off the internal compilation cache")
|
||||||
|
(current-with-cache? #f)]
|
||||||
[("--compress-javascript")
|
[("--compress-javascript")
|
||||||
("Compress JavaScript with Google Closure (requires Java)")
|
("Compress JavaScript with Google Closure (requires Java)")
|
||||||
(current-compress-javascript? #t)]
|
(current-compress-javascript? #t)]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user