File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 3131(println " ;; amap" )
3232(simple-benchmark [arr (to-array (range 1000000 ))] (amap arr i ret (* 10 (aget arr i))) 1 )
3333
34+ (println " ;; js-keys" )
35+ (simple-benchmark [obj (js-obj " a" 1 " b" 2 ) f js-keys] (f obj) 400000 )
36+ (simple-benchmark [obj (js-obj " a" 1 " b" 2 " c" 3 " d" 4 " e" 5 " f" 6 ) f js-keys] (f obj) 400000 )
37+
3438(println " ;;; instance?" )
3539; ; WARNING: will get compiled away under advanced
3640(simple-benchmark [coll []] (instance? PersistentVector coll) 1000000 )
Original file line number Diff line number Diff line change @@ -2150,9 +2150,7 @@ reduces them without incurring seq initialization"
21502150(defn js-keys
21512151 " Return the JavaScript keys for an object."
21522152 [obj]
2153- (let [keys (array )]
2154- (gobject/forEach obj (fn [val key obj] (.push keys key)))
2155- keys))
2153+ (gobject/getKeys obj))
21562154
21572155(defn js-delete
21582156 " Delete a property from a JavaScript object."
You can’t perform that action at this time.
0 commit comments