cljs-persistent-hash-map-vs-records-minuscule
JavaScript performance comparison
Info
ClojureScript PersistentHashMap performance test: assoc 4 elements onto a PHM vs. same for a defrecord with four fields vs. same for a defrecord with no fields. (NB. for the final case the extension map of the record will be a PHM.)
See CLJS-178.
For a readable version of the preparation code see https://github.com/michalmarczyk/cljs-persistent-hash-map-test.
Preparation code
<script>
Benchmark.prototype.setup = function() {
m = null;
k1 = phm.make_keyword("a");
k2 = phm.make_keyword("s");
k3 = phm.make_keyword("d");
k4 = phm.make_keyword("f");
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
PersistentHashMap |
|
pending… |
Record (fields) |
|
pending… |
Record (extmap) |
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:
- Revision 1: published by Michał Marczyk
- Revision 2: published
0 comments