Skip to content

Instantly share code, notes, and snippets.

View oakmac's full-sized avatar

Chris Oakman oakmac

View GitHub Profile
@oakmac
oakmac / gist:588352a395c2e721c031
Created January 16, 2016 19:18
parinfer.py v0.4.0 perf
Testing file with 2864 lines
Indent Mode: 0.93783 s
Paren Mode: 0.967327 s
7491416 function calls in 2.092 seconds
Ordered by: standard name
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 2.092 2.092 <string>:1(<module>)
1270904 0.316 0.000 0.663 0.000 parinfer.py:100(getPrevCh)
@oakmac
oakmac / gist:6d51111a1ed5b67ab30d
Created January 16, 2016 19:18
parinfer.py v0.5.0 perf
Testing file with 2864 lines
Indent Mode: 0.241771 s
Paren Mode: 0.253551 s
1021812 function calls in 0.480 seconds
Ordered by: standard name
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.480 0.480 <string>:1(<module>)
303 0.000 0.000 0.000 0.000 parinfer.py:119(cacheErrorPos)
@oakmac
oakmac / test.kt
Created January 31, 2016 05:40
kotlin hashmap?
val PARENS = HashMap<String, String>
PARENS.put("{", "}")
PARENS.put("}", "{")
PARENS.put("[", "]")
PARENS.put("]", "[")
PARENS.put("(", ")")
PARENS.put(")", "(")
oakmac@oakmac-desktop:~/parinfer-jvm$ lein run
Exception in thread "main" java.lang.ClassNotFoundException: ParinferKt.indentMode, compiling:(parinfer_test/core.clj:11:12)
at clojure.lang.Compiler.analyze(Compiler.java:6688)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3766)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6870)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3834)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6870)
(defn- now []
(System/currentTimeMillis))
(defn- speed-test []
(let [lots-o-clojure (slurp "tests/really_long_file")
before-indent (now)
result1 (indent-mode lots-o-clojure nil nil nil)
after-indent (now)
before-paren (now)
@oakmac
oakmac / perf.txt
Created February 3, 2016 01:39
parinfer.js performance using null
performance for parinfer.js using null
oakmac@oakmac-desktop:~/parinfer/lib$ node test/perf.js
Processing long_map_with_strings : 303 lines, 4380 chars
indent: 9.467ms
paren: 8.073ms
Processing really_long_file : 2865 lines, 112431 chars
indent: 22.413ms
paren: 30.437ms
@oakmac
oakmac / perf.txt
Created February 3, 2016 01:41
parinfer.js performance using SENTINEL_NULL
performance for parinfer.js using SENTINEL_NULL
oakmac@oakmac-desktop:~/parinfer/lib$ node test/perf.js
Processing long_map_with_strings : 303 lines, 4380 chars
indent: 8.627ms
paren: 3.932ms
Processing really_long_file : 2865 lines, 112431 chars
indent: 12.117ms
paren: 22.751ms
oakmac@oakmac-desktop:~/parinfer/lib$ node test/perf.js
Processing long_map_with_strings : 303 lines, 4380 chars
indent: 8.528ms
paren: 4.110ms
Processing really_long_file : 2865 lines, 112431 chars
indent: 11.779ms
paren: 17.577ms
Processing really_long_file_with_unclosed_paren : 2865 lines, 112432 chars
@oakmac
oakmac / example.cljs
Created February 13, 2016 19:30
branching off CLJS code
(when js/webRequest
;; code that references webRequest goes here
)
(let [a (:a my-map)
b (:b my-map)
c (:c my-map)]
(do-a-thing a b c))