Skip to content

Instantly share code, notes, and snippets.

@jakebolewski
Created August 13, 2014 06:16
Show Gist options
  • Save jakebolewski/105415d9a0c1883135e7 to your computer and use it in GitHub Desktop.
Save jakebolewski/105415d9a0c1883135e7 to your computer and use it in GitHub Desktop.
Frontend Profile for Tim Holy's examples
profiling the front-end
autogenerated test file 1:
julia> function makescript(filename)
open(filename, "w") do file; write(file, "begin\n")
for i = 1:10_000
funcname = "myfunc$i"
write(file, "function $funcname(x)\n x^2\nend\n")
end; write(file, "end")
end
end
julia/src [jcb/frontendperf●] » flisp test.scm
Parser Elapsed time: 1.325154066085815 seconds
Syntax Elapsed time: 5.899738073348999 seconds
Function #Calls Time (seconds)
-------- ------ --------------
julia-expand-macros 1 0.04523181915283203
flatten-scopes 1 0.1927700042724609
analyze-variables 1 0.3877229690551758
toplevel-expr-globals 1 0.4186370372772217
julia-expand01 1 0.5400261878967285
to-goto-form 1 0.9706499576568604
add-local-decls 1 3.219017028808594
identify-locals 1 3.219019889831543
julia-expand1 1 4.770179986953735
expand-toplevel-expr-- 1 5.774687051773071
expand-toplevel-expr- 1 5.899724960327148
expand-toplevel-expr 1 5.899734020233154
# drilling down into add-local-decls
julia/src [jcb/frontendperf●] » flisp test.scm
Parser Elapsed time: 1.322654008865356 seconds
Syntax Elapsed time: 8.782910823822021 seconds
Function #Calls Time (seconds)
-------- ------ --------------
declared-local!-vars 80003 0.1391019821166992
find-locals 10001 0.3408386707305908
remove-local-decls 10001 0.7268431186676025
declared-global-vars 20002 1.435235023498535
add-local-decls 1 5.448393106460571
autogenerated test file 2:
julia> function makescript(filename)
open(filename, "w") do file
write(file, "begin\n"); for i = 1:10_000
funcname = "myfunc$i"
write(file, "function $funcname(x)\n x^2\nend\n")
end
write(file, "x = 3.2\n")
for i = 1:10_000
funcname = "myfunc$i"
write(file, "$funcname(x)\n")
end; write(file, "end")
end
end
julia/src [jcb/frontendperf●] » flisp test.scm
Elapsed time: 1.846035957336426 seconds
Elapsed time: 7.259191989898682 seconds
Function #Calls Time (seconds)
-------- ------ --------------
julia-expand-macros 1 0.05517816543579102
flatten-scopes 1 0.2425699234008789
toplevel-expr-globals 1 0.3962099552154541
analyze-variables 1 0.4532489776611328
julia-expand01 1 0.6166150569915771
to-goto-form 1 1.493684053421021
add-local-decls 1 3.857787847518921
identify-locals 1 3.857789993286133
julia-expand1 1 6.047311067581177
expand-toplevel-expr-- 1 7.115795850753784
expand-toplevel-expr- 1 7.259175062179565
expand-toplevel-expr 1 7.259181022644043
julia/src [jcb/frontendperf●] » flisp test.scm
Elapsed time: 1.862179040908813 seconds
Elapsed time: 9.896605968475342 seconds
Function #Calls Time (seconds)
-------- ------ --------------
declared-local!-vars 90005 0.1896469593048096
find-locals 10001 0.3898797035217285
remove-local-decls 10001 0.8961589336395264
declared-global-vars 20002 1.666327238082886
add-local-decls 1 6.51598596572876
#--- 20_000 function file ---
julia/src [jcb/frontendperf●] » flisp test.scm
Elapsed time: 3.808554887771606 seconds
Elapsed time: 17.96808910369873 seconds
Function #Calls Time (seconds)
-------- ------ --------------
julia-expand-macros 1 0.1146149635314941
flatten-scopes 1 0.5463290214538574
analyze-variables 1 0.7830660343170166
julia-expand01 1 1.229053020477295
toplevel-expr-globals 1 1.241382122039795
to-goto-form 1 1.518464088439941
add-local-decls 1 12.27766108512878
identify-locals 1 12.27766489982605
julia-expand1 1 15.12554407119751
expand-toplevel-expr-- 1 17.71152210235596
expand-toplevel-expr- 1 17.96807098388672
expand-toplevel-expr 1 17.96807813644409
# --- 30_000 --- function file
<segfault>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment