[ANN] ProfileVega.jl

ProfileVega.jl is a small package that visualizes profile results with VegaLite.jl. The API is almost identical to ProfileSVG.jl.

This works especially well for JupyterLab and nteract, where this package gives you nice interactivity inside a notebook environment. You can of course also use it from the REPL.

21 Likes

That’s awesome, thanks!

I should add that I plan to add this natively to the VS Code extension as well. No timeline, but it should actually be fairly simple.

4 Likes

Very useful, thanks!

Running the example on the README:

function profile_test(n)
    for i = 1:n
        A = randn(100,100,20)
        m = maximum(A)
        Am = mapslices(sum, A; dims=2)
        B = A[:,:,5]
        Bsort = mapslices(sort, B; dims=1)
        b = rand(100)
        C = B.*b
    end
end

profile_test(1)   # run once to compile

using Profile, ProfileVega
Profile.clear()
@profview profile_test(10)

I get some warnings:

WARN Can not resolve event source: window

Here is a screenshot:

These warnings are generated when one tries to display an interactive vega-lite spec in Jupyter. Whenever such a spec is displayed, we also create a PNG version in the background that is shipped to Jupyter, so that such a notebook displays something, even if the specific notebook client doesn’t support interactive features. This warning comes up during the PNG generation.

For now you can just ignore the message.

I’m about to merge a PR to VegaLite#master that hides that message, so in the future this should just go away.

1 Like