github2-x
2018-12-14 18:31:27

samth
2018-12-14 18:54:55
[samth@huor:~/sw/pycket (master) plt] PLT_LINKLET_TIMES=1 pk -l racket/base
;; boot                                     9 [  0] ms
;; make-instance                            0 [  0] ms ; 196 times
;; instantiate-linklet                    372 [ 22] ms ; 302 times
;; startup                                872 [369] ms ; 1 times
;;   expander-linklet                       1 [  0] ms ; 1 times
;;   json-load                            283 [191] ms ; 2 times
;;   json-to-ast                          586 [178] ms ; 2 times
;;   fasl-linklet                           0 [  0] ms ; 1 times
;;   set-params                             2 [  0] ms ; 1 times
;; read                                  1215 [367] ms
;;   fasl->s-exp                          390 [ 36] ms ; 78 times
;;   s-exp->ast                           762 [320] ms ; 78 times
;;   assign-convert-deserialize            63 [ 11] ms ; 1821 times
;; total                                 2470 [758] ms

cadr
2018-12-14 18:59:11

It seems to be fasl->s-exp that’s problematic


cadr
2018-12-14 18:59:18

PLT_LINKLET_TIMES=1 p -l racket/base ;; boot 2 [0] ms ;; make-instance 0 [0] ms ; 196 times ;; instantiate-linklet 508 [72] ms ; 302 times ;; startup 1080 [441] ms ; 1 times ;; expander-linklet 1 [0] ms ; 1 times ;; json-load 356 [247] ms ; 2 times ;; json-to-ast 713 [193] ms ; 2 times ;; fasl-linklet 0 [0] ms ; 1 times ;; set-params 9 [1] ms ; 1 times ;; read 6618 [500] ms ;; fasl->s-exp 6359 [442] ms ; 78 times ;; s-exp->ast 158 [29] ms ; 78 times ;; assign-convert-deserialize 100 [29] ms ; 1821 times ;; total 8210 [1013] ms


samth
2018-12-14 19:01:56

but you made s-exp->ast much faster


samth
2018-12-14 19:02:46

fasl->s-exp is also running lots of racket code in a loop


samth
2018-12-14 19:02:51

and note that it has no imports


github2-x
2018-12-14 20:10:33

github2-x
2018-12-14 22:07:22

samth
2018-12-15 02:22:21

@cadr one way to not load the expander: create a program in racket that uses compile-linklet and instantiate-linklet to run a loop. Then run that program in old pycket, which doesn’t load the expander.


github2-x
2018-12-15 03:14:41

samth
2018-12-15 03:15:43

@cadr basically this: #lang racket/base (define N 10) (let countdown ([n N]) (if (< n 0) 1 (countdown (- n 1)))) (require racket/linklet) (define l (compile-linklet `(linklet () () (display ((letrec-values (((countdown) (lambda (n) (if (< n 0) 1 (countdown (- n 1)))))) countdown) ,N))) )) (void (instantiate-linklet l null))


samth
2018-12-15 03:15:52

but note that it need the commit I just pushed


samth
2018-12-15 03:16:07

and you probably want to run it with a much larger N to get a trace


github2-x
2018-12-15 03:18:46