Coder Social home page Coder Social logo

Snoopi "misses" top-level functions if the whole block gets inferred. i.e. `@time @snoopi` breaks results. about snoopcompile.jl HOT 3 OPEN

timholy avatar timholy commented on August 29, 2024
Snoopi "misses" top-level functions if the whole block gets inferred. i.e. `@time @snoopi` breaks results.

from snoopcompile.jl.

Comments (3)

NHDaly avatar NHDaly commented on August 29, 2024

For completeness, the relevant section in the @time macro that makes it different from my elapsed-time measurement is this while false end trick to force the compiler to compile the whole block:

https://github.com/JuliaLang/julia/blob/4422648a3c4d136dc1c2f5617041cae95e05dbaf/base/timing.jl#L182

from snoopcompile.jl.

NHDaly avatar NHDaly commented on August 29, 2024

After thinking more about this, I don't see any way to avoid this other than to put the body of the macro into an eval statement.

And I now increasingly think this would be a good change, and mirrors the way @snoopc (and @snoopl) will run the body in an entirely new julia process. It seems quite reasonable to me to run the body at the top-level. That's a less wild change and i think will provide results that are closer to what users expect! :)

Does that sound reasonable to you?

from snoopcompile.jl.

timholy avatar timholy commented on August 29, 2024

Yes, it does seem that we need to hide it a bit.

from snoopcompile.jl.

Related Issues (20)

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.