Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting the result #41

Closed
aminya opened this issue Dec 2, 2019 · 5 comments
Closed

Sorting the result #41

aminya opened this issue Dec 2, 2019 · 5 comments

Comments

@aminya
Copy link
Contributor

aminya commented Dec 2, 2019

Every time I run the snoopc it seems that a new file is generated (which causes duplicate PR in #37). Is it possible to sort the result before writing it to the file?

@aminya aminya changed the title Different result every time? (snoopc) Sorting the result Dec 3, 2019
@timholy
Copy link
Owner

timholy commented Dec 5, 2019

If you use @snoopi, only the things that weren't successfully precompiled by the old statements will show up. There are some things that Julia refuses to cache (JuliaLang/julia#32705), but in general this greatly reduces duplicates.

I don't know how you'd sort them "rationally," since there is no total order. Maybe alphabetically?

@aminya
Copy link
Contributor Author

aminya commented Dec 5, 2019

@timholy
Copy link
Owner

timholy commented Dec 7, 2019

Can you play with the new version (especially under Julia 1.4) and see whether you still want this? The format of the precompile statements has changed quite a bit, especially if there are generated functions, keyword functions, etc. Some of the new precompile statements look like this:

    let fbody = try __lookup_kwbody__(which(show, (IOStream,MIME{Symbol("image/png")},Array{Gray{Normed{UInt8,8}},2},))) catch missing end
        if !ismissing(fbody)
            precompile(fbody, (Int64,Int64,Function,typeof(show),IOStream,MIME{Symbol("image/png")},Array{Gray{Normed{UInt8,8}},2},))
        end
    end

The current sorting order is by time, with the slowest-to-compile coming last.

@aminya
Copy link
Contributor Author

aminya commented Dec 10, 2019

I will test it sometime this week. If the timing is always stable and consistent that can be a good sorting measure.

@timholy
Copy link
Owner

timholy commented Dec 10, 2019

Actually, SnoopCompile 1.1 is already released and contains this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants