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 31
31
(println " ;; amap" )
32
32
(simple-benchmark [arr (to-array (range 1000000 ))] (amap arr i ret (* 10 (aget arr i))) 1 )
33
33
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
+
34
38
(println " ;;; instance?" )
35
39
; ; WARNING: will get compiled away under advanced
36
40
(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"
2150
2150
(defn js-keys
2151
2151
" Return the JavaScript keys for an object."
2152
2152
[obj]
2153
- (let [keys (array )]
2154
- (gobject/forEach obj (fn [val key obj] (.push keys key)))
2155
- keys))
2153
+ (gobject/getKeys obj))
2156
2154
2157
2155
(defn js-delete
2158
2156
" Delete a property from a JavaScript object."
You can’t perform that action at this time.
0 commit comments