Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

moving stuff around

  • Loading branch information...
commit 6ef1d9c95bef027133208a0ec22393b3f982eca8 1 parent 1ed952e
@joshaber authored
Showing with 1 addition and 221 deletions.
  1. +1 −1  .gitignore
  2. +0 −144 benchmark/cljs/benchmark_runner.cljs
  3. 0  {samples → examples}/DemoApp/DemoApp.xcodeproj/project.pbxproj
  4. 0  {samples → examples}/DemoApp/DemoApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  5. 0  {samples → examples}/DemoApp/DemoApp/DAPAppDelegate.h
  6. 0  {samples → examples}/DemoApp/DemoApp/DAPAppDelegate.m
  7. 0  {samples → examples}/DemoApp/DemoApp/DAPTest.h
  8. 0  {samples → examples}/DemoApp/DemoApp/DAPTest.m
  9. 0  {samples → examples}/DemoApp/DemoApp/DemoApp-Info.plist
  10. 0  {samples → examples}/DemoApp/DemoApp/DemoApp-Prefix.pch
  11. 0  {samples → examples}/DemoApp/DemoApp/en.lproj/Credits.rtf
  12. 0  {samples/DemoApp/DemoAppTests → examples/DemoApp/DemoApp}/en.lproj/InfoPlist.strings
  13. 0  {samples → examples}/DemoApp/DemoApp/en.lproj/MainMenu.xib
  14. 0  {samples → examples}/DemoApp/DemoApp/main.m
  15. 0  {samples → examples}/DemoApp/DemoAppTests/DemoAppTests-Info.plist
  16. 0  {samples → examples}/DemoApp/DemoAppTests/DemoAppTests.h
  17. 0  {samples → examples}/DemoApp/DemoAppTests/DemoAppTests.m
  18. 0  {samples/DemoApp/DemoApp → examples/DemoApp/DemoAppTests}/en.lproj/InfoPlist.strings
  19. 0  {samples → examples}/DemoApp/cljm/hello/core.cljm
  20. 0  {samples → examples}/DemoApp/cljm/hello/foo/bar.cljm
  21. +0 −2  samples/hello_m/.gitignore
  22. +0 −34 samples/hello_m/README.md
  23. +0 −8 samples/hello_m/src/hello/core.cljm
  24. +0 −26 samples/hello_m/src/hello/foo/bar.cljm
  25. +0 −6 samples/hello_m/src/hello/foo/main.cljm
View
2  .gitignore
@@ -5,4 +5,4 @@
/out
.repl
-samples/DemoApp/gen
+examples/DemoApp/gen
View
144 benchmark/cljs/benchmark_runner.cljs
@@ -1,144 +0,0 @@
-(ns cljs.benchmark-runner
- (:refer-clojure :exclude [println])
- (:require [cljs.reader :as reader]))
-
-(def println print)
-
-(set! *print-fn* js/print)
-
-(simple-benchmark [x 1] (identity x) 1000000)
-
-(println ";; array-reduce & ci-reduce")
-(def arr (let [arr (array)]
- (dotimes [i 1000000]
- (.push arr i))
- arr))
-(defn sum [a b] (+ a b))
-(simple-benchmark [coll (seq arr)] (ci-reduce coll + 0) 1)
-(simple-benchmark [coll (seq arr)] (ci-reduce coll sum 0) 1)
-(simple-benchmark [coll arr] (array-reduce coll + 0) 1)
-(simple-benchmark [coll arr] (array-reduce coll sum 0) 1)
-
-(println ";;; instance?")
-;; WARNING: will get compiled away under advanced
-(simple-benchmark [coll []] (instance? PersistentVector coll) 1000000)
-(println ";;; satisfies?")
-(simple-benchmark [coll (list 1 2 3)] (satisfies? ISeq coll) 1000000)
-(simple-benchmark [coll [1 2 3]] (satisfies? ISeq coll) 1000000)
-(println)
-
-(println ";;; list ops")
-(simple-benchmark [coll (list 1 2 3)] (first coll) 1000000)
-(simple-benchmark [coll (list 1 2 3)] (-first coll) 1000000)
-(simple-benchmark [coll (list 1 2 3)] (rest coll) 1000000)
-(simple-benchmark [coll (list 1 2 3)] (-rest coll) 1000000)
-(simple-benchmark [] (list) 1000000)
-(simple-benchmark [] (list 1 2 3) 1000000)
-(println)
-
-(println ";;; vector ops")
-(simple-benchmark [] [] 1000000)
-(simple-benchmark [] [1 2 3] 1000000)
-(simple-benchmark [coll [1 2 3]] (transient coll) 100000)
-(simple-benchmark [coll [1 2 3]] (nth coll 0) 1000000)
-(simple-benchmark [coll [1 2 3]] (-nth coll 0) 1000000)
-(simple-benchmark [coll [1 2 3]] (conj coll 4) 1000000)
-(simple-benchmark [coll [1 2 3]] (-conj coll 4) 1000000)
-(simple-benchmark [coll [1 2 3]] (seq coll) 1000000)
-(simple-benchmark [coll (seq [1 2 3])] (first coll) 1000000)
-(simple-benchmark [coll (seq [1 2 3])] (-first coll) 1000000)
-(simple-benchmark [coll (seq [1 2 3])] (rest coll) 1000000)
-(simple-benchmark [coll (seq [1 2 3])] (-rest coll) 1000000)
-(simple-benchmark [coll (seq [1 2 3])] (next coll) 1000000)
-(println)
-
-(println ";;; transients")
-(print "transient vector, conj! 1000000 items")
-(time
- (let [v (transient [])]
- (loop [i 0 v v]
- (if (> i 1000000)
- (persistent! v)
- (recur (inc i) (conj! v i))))))
-
-(println ";;; reduce lazy-seqs, vectors, ranges")
-(simple-benchmark [coll (take 100000 (iterate inc 0))] (reduce + 0 coll) 1)
-(simple-benchmark [coll (range 1000000)] (reduce + 0 coll) 1)
-(simple-benchmark [coll (into [] (range 1000000))] (reduce + 0 coll) 1)
-(println)
-
-(println ";;; map / record ops")
-(simple-benchmark [coll {:foo 1 :bar 2}] (get coll :foo) 1000000)
-(simple-benchmark [coll {:foo 1 :bar 2}] (-lookup coll :foo nil) 1000000)
-(simple-benchmark [coll {:foo 1 :bar 2}] (:foo coll) 1000000)
-(defrecord Foo [bar baz])
-(simple-benchmark [coll (Foo. 1 2)] (:bar coll) 1000000)
-(simple-benchmark [coll {:foo 1 :bar 2}] (assoc coll :baz 3) 100000)
-(simple-benchmark [coll {:foo 1 :bar 2}] (assoc coll :foo 2) 100000)
-(simple-benchmark [coll {:foo 1 :bar 2}]
- (loop [i 0 m coll]
- (if (< i 100000)
- (recur (inc i) (assoc m :foo 2))
- m))
- 1)
-(println ";;; persistent hash maps")
-(def pmap (into cljs.core.PersistentHashMap/EMPTY
- [[:a 0] [:b 1] [:c 2] [:d 3] [:e 4] [:f 5] [:g 6] [:h 7]
- [:i 8] [:j 9] [:k 10] [:l 11] [:m 12] [:n 13] [:o 14] [:p 15]
- [:q 16] [:r 17] [:s 18] [:t 19] [:u 20] [:v 21] [:w 22] [:x 23]
- [:y 24] [:z 25] [:a0 26] [:b0 27] [:c0 28] [:d0 29] [:e0 30] [:f0 31]]))
-(simple-benchmark [key :f0] (hash key) 1000000)
-(simple-benchmark [key :unsynchronized-mutable] (hash key false) 1000000)
-(simple-benchmark [key :unsynchronized-mutable] (hash key) 1000000)
-(def hash-coll-test
- (loop [i 0 r []]
- (if (< i 1000)
- (recur (inc i) (conj r (str "foo" i)))
- r)))
-(simple-benchmark [coll hash-coll-test] (hash-coll coll) 100)
-(simple-benchmark [coll pmap] (:f0 coll) 1000000)
-(simple-benchmark [coll pmap] (get coll :f0) 1000000)
-(simple-benchmark [coll pmap] (-lookup coll :f0 nil) 1000000)
-(simple-benchmark [coll pmap] (assoc coll :g0 32) 1000000)
-(simple-benchmark [coll pmap]
- (loop [i 0 m coll]
- (if (< i 1000000)
- (recur (inc i) (assoc m :a 1))
- m))
- 1)
-(simple-benchmark [coll cljs.core.PersistentHashMap/EMPTY] (assoc coll :f0 1) 1000000)
-(println)
-
-(println ";;; set ops")
-(simple-benchmark [] #{} 100000)
-(simple-benchmark [] #{1 2 3} 100000)
-(simple-benchmark [coll #{1 2 3}] (conj coll 4) 100000)
-(println)
-
-(println ";;; seq ops")
-(simple-benchmark [coll (range 500000)] (reduce + coll) 1)
-(println)
-
-(println ";;; reader")
-(simple-benchmark [s "{:foo [1 2 3]}"] (reader/read-string s) 1000)
-(println)
-
-(println ";;; range")
-(simple-benchmark [r (range 1000000)] (last r) 1)
-(println)
-
-(defn ints-seq
- ([n] (ints-seq 0 n))
- ([i n]
- (when (< i n)
- (lazy-seq
- (cons i (ints-seq (inc i) n))))))
-(def r (ints-seq 1000000))
-(println ";;; lazy-seq")
-(println ";;; first run")
-(simple-benchmark [r r] (last r) 1)
-(println ";;; second run")
-(simple-benchmark [r r] (last r) 1)
-(println)
-
-(println "\n")
View
0  samples/DemoApp/DemoApp.xcodeproj/project.pbxproj → examples/DemoApp/DemoApp.xcodeproj/project.pbxproj
File renamed without changes
View
0  ...proj/project.xcworkspace/contents.xcworkspacedata → ...proj/project.xcworkspace/contents.xcworkspacedata
File renamed without changes
View
0  samples/DemoApp/DemoApp/DAPAppDelegate.h → examples/DemoApp/DemoApp/DAPAppDelegate.h
File renamed without changes
View
0  samples/DemoApp/DemoApp/DAPAppDelegate.m → examples/DemoApp/DemoApp/DAPAppDelegate.m
File renamed without changes
View
0  samples/DemoApp/DemoApp/DAPTest.h → examples/DemoApp/DemoApp/DAPTest.h
File renamed without changes
View
0  samples/DemoApp/DemoApp/DAPTest.m → examples/DemoApp/DemoApp/DAPTest.m
File renamed without changes
View
0  samples/DemoApp/DemoApp/DemoApp-Info.plist → examples/DemoApp/DemoApp/DemoApp-Info.plist
File renamed without changes
View
0  samples/DemoApp/DemoApp/DemoApp-Prefix.pch → examples/DemoApp/DemoApp/DemoApp-Prefix.pch
File renamed without changes
View
0  samples/DemoApp/DemoApp/en.lproj/Credits.rtf → examples/DemoApp/DemoApp/en.lproj/Credits.rtf
File renamed without changes
View
0  ...s/DemoApp/DemoAppTests/en.lproj/InfoPlist.strings → examples/DemoApp/DemoApp/en.lproj/InfoPlist.strings
File renamed without changes
View
0  samples/DemoApp/DemoApp/en.lproj/MainMenu.xib → examples/DemoApp/DemoApp/en.lproj/MainMenu.xib
File renamed without changes
View
0  samples/DemoApp/DemoApp/main.m → examples/DemoApp/DemoApp/main.m
File renamed without changes
View
0  samples/DemoApp/DemoAppTests/DemoAppTests-Info.plist → ...ples/DemoApp/DemoAppTests/DemoAppTests-Info.plist
File renamed without changes
View
0  samples/DemoApp/DemoAppTests/DemoAppTests.h → examples/DemoApp/DemoAppTests/DemoAppTests.h
File renamed without changes
View
0  samples/DemoApp/DemoAppTests/DemoAppTests.m → examples/DemoApp/DemoAppTests/DemoAppTests.m
File renamed without changes
View
0  samples/DemoApp/DemoApp/en.lproj/InfoPlist.strings → ...s/DemoApp/DemoAppTests/en.lproj/InfoPlist.strings
File renamed without changes
View
0  samples/DemoApp/cljm/hello/core.cljm → examples/DemoApp/cljm/hello/core.cljm
File renamed without changes
View
0  samples/DemoApp/cljm/hello/foo/bar.cljm → examples/DemoApp/cljm/hello/foo/bar.cljm
File renamed without changes
View
2  samples/hello_m/.gitignore
@@ -1,2 +0,0 @@
-out/
-hello.js
View
34 samples/hello_m/README.md
@@ -1,34 +0,0 @@
-Simple ClojureScript Project Example.
-
-One-time Setup
-==============
-
-- Create a CLOJURESCRIPT_HOME environment variable which points to the
- ClojureScript root directory.
-
-- If you have not already done so, execute
-
- $CLOJURESCRIPT_HOME/script/bootstrap
-
-- Add $CLOJURESCRIPT_HOME/bin to your PATH.
-
-Run in Development Mode
-=======================
-
-Development mode allows for each file to be loaded in a separate script tag so
-that errors can be easily tracked to the offending file.
-
- cljsc src > hello.js
-
-After running the above command, open hello-dev.html. Notice that each required
-JavaScript file has been loaded in its most readable form.
-
-Run Optimized JavaScript
-========================
-
-Once an application is ready for production, a single optimized file can be produced.
-
- cljsc src {:optimizations :advanced} > hello.js
-
-After running the above command, open hello.html to view the result.
-
View
8 samples/hello_m/src/hello/core.cljm
@@ -1,8 +0,0 @@
-(ns hello.core
- (:require [hello.foo.bar :as bar]))
-
-(defn ^{:export greet} greet [n]
- (str "Hello " n))
-
-(defn ^:export sum [xs]
- (bar/sum xs))
View
26 samples/hello_m/src/hello/foo/bar.cljm
@@ -1,26 +0,0 @@
-(ns hello.foo.bar)
-
-(def blah "hi")
-(def stuff [1 2 3])
-(def wat {:hi 1 :something 2})
-(def more #{1 3 4})
-
-(defn- uppers
- [x]
- (if false "hi" "no"))
-
-(defn nslog
- [& x]
- (do
- (objc* "NSLog(@\"%@\", ~{x});" x)
- nil))
-
-(defn uppercase-the-bitches
- [x]
- (.uppercaseString x))
-
-(defn the-things
- [the-int-man]
- 1)
-
-(nslog "hi")
View
6 samples/hello_m/src/hello/foo/main.cljm
@@ -1,6 +0,0 @@
-(ns hello.foo.main
- (:require [hello.foo.bar :as bar]))
-
-(defn main
- [x]
- (bar/nslog "hi"))
Please sign in to comment.
Something went wrong with that request. Please try again.