ProfileSVG.jl icon indicating copy to clipboard operation
ProfileSVG.jl copied to clipboard

Showing full specialization

Open kimikage opened this issue 4 years ago • 3 comments

cf. https://github.com/timholy/ProfileView.jl/pull/164

However, there is currently not enough room to display it. I think we will probably need a new popup UI.

kimikage avatar Jan 24 '21 06:01 kimikage

The following excellent JuliaCon2021 workshop is a good reference on this. :+1:

Package development: improving engineering quality & latency

https://pretalx.com/juliacon2021/talk/VY9UVX/

And you would be disappointed that the method arguments are not shown. :sob: Unfortunately I don't have enough time right now to do any enhancements to this package.

However, if you just want to display the specialization information, you should be able to insert the data of sf.linfo into the following shortinfo variable, referring to the PR of ProfileView above. https://github.com/kimikage/ProfileSVG.jl/blob/70b3912f7c8715114567638000a0a66bd52cd91f/src/ProfileSVG.jl#L315

kimikage avatar Jul 26 '21 11:07 kimikage

Also, the following time axis settings may be useful.

ProfileSVG.set_default(timeunit=:ms, delay=1e-9)

kimikage avatar Jul 28 '21 03:07 kimikage

PR #62 makes it easier to apply a monkey patch. For example:

function ProfileSVG.extract_frameinfo(sf::ProfileSVG.StackFrame)
    file = string(sf.file)
    m = match(r"[^\\/]+$", file)
    if m !== nothing
        dirinfo = SubString(file, firstindex(file), m.offset - 1)
        basename = m.match
    else
        dirinfo = ""
        basename = file
    end
    func = sf.func
    if sf.linfo isa Core.MethodInstance
        func = replace(string(sf.linfo), "MethodInstance for " => "")
    end
    shortinfo = "$func in $basename:$(sf.line)"
    return shortinfo, dirinfo
end

profilesvg

I have no plans to make a tag release for this for now. Please use pkg> add ProfileSVG#master.

kimikage avatar Aug 06 '21 05:08 kimikage