Coder Social home page Coder Social logo

Not precompiling? about docopt.jl HOT 5 CLOSED

docopt avatar docopt commented on August 24, 2024
Not precompiling?

from docopt.jl.

Comments (5)

jeff-regier avatar jeff-regier commented on August 24, 2024

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.

jeff-regier avatar jeff-regier commented on August 24, 2024

@tkelman suggests using SnoopCompile.jl to pre-compile the docopt function and the functions it calls.

from docopt.jl.

bicycle1885 avatar bicycle1885 commented on August 24, 2024

I'm sorry for the delayed reply. I will take a look next week.

from docopt.jl.

mweastwood avatar mweastwood commented on August 24, 2024

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.

jeff-regier avatar jeff-regier commented on August 24, 2024

Good to know, thanks for looking into it!

from docopt.jl.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.