Skip to content

Instantly share code, notes, and snippets.

@binarybana
Created December 16, 2012 20:03
Show Gist options
  • Save binarybana/4312218 to your computer and use it in GitHub Desktop.
Save binarybana/4312218 to your computer and use it in GitHub Desktop.
A minimal test case for an inter-module profiling bug.
require("fancy")
using Fancy
do_fancy(100)
Fancy.@profile report
require("fancy")
using Fancy
require("profile")
using Profile
do_fancy(100)
@profile report
module Fancy
export do_fancy
require("profile")
using Profile
@profile begin
function do_fancy(x::Int)
myarray = randn(x,x)
for i in 1:x
myarray[i,i] = calc_diag(i)
end
myarray
end
function calc_diag(i::Int)
exp(i)
end
end #@profile
end # module Fancy
bana-desktop:~/G/c/j/prof$ julia driver.jl # driver_1
type error: getfield: expected Symbol, got Expr
in include at boot.jl:237
at driver.jl:5
bana-desktop:~/G/c/j/prof$ julia driver.jl # driver_2
in module path: Profile not defined
in include at boot.jl:237
at driver.jl:5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment