measure resolver time instead of resolve calls in instantiate

The total time of module name resolver calls is more useful, because
each one takes longer, there should be many fewer, and there are
tasks that end up resolving module paths.
This commit is contained in:
Matthew Flatt 2019-06-11 15:53:00 -06:00
parent a0ce64c5c4
commit 41dc6f1335
3 changed files with 563 additions and 560 deletions

View File

@ -2,6 +2,7 @@
(require racket/private/place-local
ffi/unsafe/atomic
"../compile/serialize-property.rkt"
"../common/performance.rkt"
"contract.rkt"
"parse-module-path.rkt"
"intern.rkt")
@ -200,13 +201,15 @@
(define/who (module-path-index-resolve mpi [load? #f])
(check who module-path-index? mpi)
(or (module-path-index-resolved mpi)
(let ([mod-name ((current-module-name-resolver)
(let ([mod-name (performance-region
['eval 'resolver]
((current-module-name-resolver)
(module-path-index-path mpi)
(module-path-index-resolve/maybe
(module-path-index-base mpi)
load?)
#f
load?)])
load?))])
(unless (resolved-module-path? mod-name)
(raise-arguments-error 'module-path-index-resolve
"current module name resolver's result is not a resolved module path"

View File

@ -372,9 +372,7 @@
#:seen [seen #hasheq()])
(unless (module-path-index? mpi)
(error "not a module path index:" mpi))
(define name (performance-region
['eval 'resolve]
(module-path-index-resolve mpi #t)))
(define name (module-path-index-resolve mpi #t))
(define m (namespace->module ns name))
(unless m (raise-unknown-module-error 'instantiate name))
(define (instantiate! instance-phase run-phase ns)

File diff suppressed because it is too large Load Diff