We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3bc6212 commit be4ca3dCopy full SHA for be4ca3d
1 file changed
test/performance_tests.jl
@@ -50,11 +50,15 @@ function bench_press(
50
Profile.Allocs.@profile sample_rate=1 foo(args...)
51
results = Profile.Allocs.fetch()
52
sorted = sort(results.allocs, by = x->x.size)
53
- sorted_str = join(sorted, "\n\n")
54
- @error sorted_str
55
- # largest allocation
56
- trace = sorted[end].stacktrace
57
- @error join(trace, "\n")
+ if isempty(sorted)
+ @info "No allocations detected using Profile.Allocs.@profile"
+ else
+ sorted_str = join(sorted, "\n\n")
+ @error sorted_str
58
+ # largest allocation
59
+ trace = sorted[end].stacktrace
60
+ @error join(trace, "\n")
61
+ end
62
Profile.clear()
63
TT.@test trail.allocs <= min_allocs
64
end
0 commit comments