Skip to content

Instantly share code, notes, and snippets.

View oakmac's full-sized avatar

Chris Oakman oakmac

View GitHub Profile
@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 / 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
(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-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)
@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 / 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 / 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-desktop:~/parinfer.py$ python perf.py
Testing file with 2864 lines
Indent Mode: 1.288776 s
Paren Mode: 1.374673 s
oakmac@oakmac-desktop:~/parinfer.py$ python perf.py
Testing file with 2864 lines
Indent Mode: 1.3307 s
Paren Mode: 1.394969 s
oakmac@oakmac-desktop:~/parinfer.py$ python perf.py
Testing file with 2864 lines
oakmac@oakmac-desktop:~/parinfer.py$ python tests.py
..
----------------------------------------------------------------------
Ran 2 tests in 0.073s
OK
oakmac@oakmac-desktop:~/parinfer.py$
@oakmac
oakmac / out.txt
Created December 24, 2015 07:19
Python Indent Mode tests pass!
Running Indent Mode tests...
Test 7 was a success.
Test 21 was a success.
Test 35 was a success.
Test 49 was a success.
Test 63 was a success.
Test 87 was a success.
Test 97 was a success.
Test 111 was a success.
Test 121 was a success.