Comments (5)
I ran it though the profiler. Looks like almost all the time is spent in inference.jl
. I believe this means it's compiling the code when its first run, and that DocOpt isn't being precompiled. I'm not sure why that would be.
803 ./inference.jl 1583 typeinf_loop(::Core.Inference.InferenceState)
812 ./inference.jl 1528 typeinf_edge(::Method, ::Any, ::SimpleVector,...
813 ./inference.jl 846 abstract_call_gf_by_type(::Any, ::Any, ::Core...
869 ./inference.jl 1037 abstract_call(::Any, ::Tuple{}, ::Array{Any,1...
921 ./inference.jl 1067 abstract_eval_call(::Expr, ::Array{Any,1}, ::...
1183 ./inference.jl 1088 abstract_eval(::Any, ::Array{Any,1}, ::Core.I...
1286 ./inference.jl 1523 typeinf_edge(::Method, ::Any, ::SimpleVector,...
from docopt.jl.
@tkelman suggests using SnoopCompile.jl to pre-compile the docopt
function and the functions it calls.
from docopt.jl.
I'm sorry for the delayed reply. I will take a look next week.
from docopt.jl.
I have experimented a little with this. Unfortunately I have bad news.
It seems the majority of the overhead from the first run of docopt
comes from compiling a bunch of Base functions. The contribution from compiling functions in the DocOpt package itself is largely negligible (you might get a few tenths of a second by doing the precompilation). Therefore you really need to compile Julia with a userimg if you want the first call of docopt
to execute quickly (I've gotten it down to ~0.3 seconds from ~2 seconds).
The routine is fairly straight forward if you follow the steps in the SnoopCompile README.
from docopt.jl.
Good to know, thanks for looking into it!
from docopt.jl.
Related Issues (15)
- DocOpt exits in interactive mode HOT 1
- Should we use `Nullable` for optional arguments? HOT 1
- MethodError: no method matching length(::DocOpt.Tokens) HOT 2
- Does not correctly handle multi-line option descriptions HOT 1
- Incorrect parsing symbols [ and ] which are mark optional part of argument. HOT 1
- return dict should be of type Dict{String,Any} HOT 1
- Not working with Julia 1.0 HOT 6
- Cannot put mandatory argument after optional ones?
- List of arguments followed by another list HOT 1
- Extremely minor doc issue HOT 1
- Not detecting special argument "--" HOT 1
- Chaging no-positional arguments order doesn't work
- [PkgEval] DocOpt may have a testing issue on Julia 0.4 (2014-08-29) HOT 1
- Tag a new release? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docopt.jl.