由mfikes发表的评论:
由于CLJ-1789补丁与更大的map结合表现更好,这里有一个针对该情况的额外性能测试,使用了该票证的数据,测试了附加的原始补丁和Erik随后的补丁。您可以看到CLJ-1789方法也对ClojureScript有益。
Erik,我看到您附加了一个第三个补丁。我建议为每个此类补丁添加性能数字,以便可以更方便地评估补丁在高级优化下的效果。
`
CLR-1789关键字相同
V8: 1.13 1.29
SpiderMonkey: 1.89 2.39
JavaScriptCore: 1.02 0.96
Nashorn: 1.12 1.42
ChakraCore: 1.68 1.82
`
之前
`
使用V8进行基准测试
;; select-keys
[m {:a "b", :c "d", :b "b", :d "d", :e "e", :f "f", :g "g"}], (select-keys m [:a :c :b :d :e :f :g]), 200000 runs, 373 msecs
使用SpiderMonkey进行基准测试
;; select-keys
[m {:a "b", :c "d", :b "b", :d "d", :e "e", :f "f", :g "g"}], (select-keys m [:a :c :b :d :e :f :g]), 200000 runs, 668 msecs
使用JavaScriptCore进行基准测试
;; select-keys
[m {:a "b", :c "d", :b "b", :d "d", :e "e", :f "f", :g "g"}], (select-keys m [:a :c :b :d :e :f :g]), 200000 runs, 200 msecs
使用Nashorn进行基准测试
;; select-keys
[m {:a "b", :c "d", :b "b", :d "d", :e "e", :f "f", :g "g"}], (select-keys m [:a :c :b :d :e :f :g]), 200000 runs, 2236 msecs
使用ChakraCore进行基准测试
;; select-keys
[m {:a "b", :c "d", :b "b", :d "d", :e "e", :f "f", :g "g"}], (select-keys m [:a :c :b :d :e :f :g]), 200000 runs, 1074 msecs
`
(keyword-identical?)之后
`
使用V8进行基准测试
;; select-keys
[m {:a "b", :c "d", :b "b", :d "d", :e "e", :f "f", :g "g"}], (select-keys m [:a :c :b :d :e :f :g]), 200000 runs, 330 msecs
使用SpiderMonkey进行基准测试
;; select-keys
[m {:a "b", :c "d", :b "b", :d "d", :e "e", :f "f", :g "g"}], (select-keys m [:a :c :b :d :e :f :g]), 200000 runs, 353 msecs
使用JavaScriptCore进行基准测试
;; select-keys
[m {:a "b", :c "d", :b "b", :d "d", :e "e", :f "f", :g "g"}], (select-keys m [:a :c :b :d :e :f :g]), 200000 runs, 197 msecs
使用Nashorn进行基准测试
;; select-keys
[m {:a "b", :c "d", :b "b", :d "d", :e "e", :f "f", :g "g"}], (select-keys m [:a :c :b :d :e :f :g]), 200000 runs, 1991 msecs
使用ChakraCore进行基准测试
;; select-keys
[m {:a "b", :c "d", :b "b", :d "d", :e "e", :f "f", :g "g"}], (select-keys m [:a :c :b :d :e :f :g]), 200000 runs, 640 msecs
`
(CLJ-1789)之后
`
使用V8进行基准测试
;; select-keys
[m {:a "b", :c "d", :b "b", :d "d", :e "e", :f "f", :g "g"}], (select-keys m [:a :c :b :d :e :f :g]), 200000 runs, 290 msecs
使用SpiderMonkey进行基准测试
;; select-keys
[[{:a "b", :c "d", :b "b", :d "d", :e "e", :f "f", :g "g"}], (select-keys m [:a :c :b :d :e :f :g]), 进行200000次运行,耗时279毫秒
使用JavaScriptCore进行基准测试
;; select-keys
[[{:a "b", :c "d", :b "b", :d "d", :e "e", :f "f", :g "g"}], (select-keys m [:a :c :b :d :e :f :g]), 进行200000次运行,耗时209毫秒
使用Nashorn进行基准测试
;; select-keys
[[{:a "b", :c "d", :b "b", :d "d", :e "e", :f "f", :g "g"}], (select-keys m [:a :c :b :d :e :f :g]), 进行200000次运行,耗时1578毫秒
使用ChakraCore进行基准测试
;; select-keys
[[{:a "b", :c "d", :b "b", :d "d", :e "e", :f "f", :g "g"}], (select-keys m [:a :c :b :d :e :f :g]), 进行200000次运行,耗时591毫秒
`