Closed darwin closed 8 years ago
Currently oops can generate key get/set code either via aget/aset or goog.object/get/goog.object/set [1].
aget
aset
goog.object/get
goog.object/set
My compilation output tests under advanced mode showed that DCE is more aggressive with goog.object implementation. Compare [2] and [3].
And I don't understand why. Any insights?
[1] https://github.com/binaryage/cljs-oops/blob/61416373ff8415410c52de1603df76375c848299/src/lib/oops/core.clj#L69-L77 [2] https://github.com/binaryage/cljs-oops/blob/master/test/transcripts/expected/basic_oget_core.js [3] https://github.com/binaryage/cljs-oops/blob/master/test/transcripts/expected/basic_oget_goog.js
Currently oops can generate key get/set code either via
aget
/aset
orgoog.object/get
/goog.object/set
[1].My compilation output tests under advanced mode showed that DCE is more aggressive with goog.object implementation. Compare [2] and [3].
And I don't understand why. Any insights?
[1] https://github.com/binaryage/cljs-oops/blob/61416373ff8415410c52de1603df76375c848299/src/lib/oops/core.clj#L69-L77 [2] https://github.com/binaryage/cljs-oops/blob/master/test/transcripts/expected/basic_oget_core.js [3] https://github.com/binaryage/cljs-oops/blob/master/test/transcripts/expected/basic_oget_goog.js