It's weird, but consistent: sorting the letrec entries slows it down! Why?
authorTony Garnock-Jones <tonygarnockjones@gmail.com>
Mon, 23 Jul 2018 18:51:54 +0100
changeset 414 5e5c61ed2e7d
parent 413 99a706eaf2cf
child 415 3d1ae8f1b0d7
It's weird, but consistent: sorting the letrec entries slows it down! Why?
experiments/little-smalltalk/jit-SmallWorld-2015.rkt
--- a/experiments/little-smalltalk/jit-SmallWorld-2015.rkt	Mon Jul 23 18:41:40 2018 +0100
+++ b/experiments/little-smalltalk/jit-SmallWorld-2015.rkt	Mon Jul 23 18:51:54 2018 +0100
@@ -429,8 +429,7 @@
                 arg)])))
 
 (define (gen-label-definitions c body-exp)
-  `(letrec (,@(for/list [(entry (in-list (sort (hash->list (compilation-labels c)) < #:key car)))]
-                (match-define (cons ip label) entry)
+  `(letrec (,@(for/list [((ip label) (in-hash (compilation-labels c)))]
                 `(,(mksym "label~a" ip) ,label)))
      ,body-exp))