-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8752392
Showing
4 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/target | ||
/lib | ||
/classes | ||
/checkouts | ||
pom.xml | ||
*.jar | ||
*.class | ||
.lein-deps-sum | ||
.lein-failures | ||
.lein-plugins | ||
.lein-cljsbuild-compiler-* | ||
/phm.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# cljs-persistent-hash-map-test | ||
|
||
A bunch of helper functions with which to build jsPerf tests for the | ||
ClojureScript port of Clojure's PersistentHashMap. | ||
|
||
## Usage | ||
|
||
See the JIRA ticket: | ||
|
||
http://dev.clojure.org/jira/browse/CLJS-178 | ||
|
||
## License | ||
|
||
Copyright © 2012 Michał Marczyk | ||
|
||
Distributed under the Eclipse Public License, the same as Clojure. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(defproject cljs-persistent-hash-map-test "0.0.1-SNAPSHOT" | ||
:description "Perf tests for ClojureScript port of Clojure's PersistentHashMap" | ||
:license {:name "Eclipse Public License" | ||
:url "http://www.eclipse.org/legal/epl-v10.html"} | ||
:source-path "src/clj/" | ||
:dependencies [[org.clojure/clojure "1.3.0"] | ||
;; locally built from | ||
;; https://github.com/michalmarczyk/clojurescript/tree/phm2 | ||
[org.clojure/clojurescript "0.0-1078"]] | ||
:plugins [[lein-cljsbuild "0.1.7"]] | ||
:cljsbuild {:builds [{:source-path "src/cljs/" | ||
:compiler {:output-to "phm.js" | ||
:optimizations :advanced | ||
:pretty-print false}}]}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
(ns phm) | ||
|
||
(defn ^:export empty-obj-map [] | ||
cljs.core.ObjMap/EMPTY) | ||
|
||
(defn ^:export empty-hash-map [] | ||
cljs.core.HashMap/EMPTY) | ||
|
||
(defn ^:export empty-persistent-hash-map [] | ||
cljs.core.PersistentHashMap/EMPTY) | ||
|
||
(defn ^:export assocwrapper [m k v] | ||
(assoc m k v)) | ||
|
||
(defn ^:export dissocwrapper [m k] | ||
(dissoc m k)) | ||
|
||
(defn ^:export getwrapper [m k] | ||
(get m k)) | ||
|
||
(defn ^:export getwrapperdefault [m k not-found] | ||
(get m k not-found)) | ||
|
||
(defn ^:export invokewrapper [m k] | ||
(m k)) | ||
|
||
(defn ^:export invokewrapperdefault [m k not-found] | ||
(m k not-found)) |