Skip to content

Commit be4ca3d

Browse files
committed
wip
1 parent 3bc6212 commit be4ca3d

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

test/performance_tests.jl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,15 @@ function bench_press(
5050
Profile.Allocs.@profile sample_rate=1 foo(args...)
5151
results = Profile.Allocs.fetch()
5252
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")
53+
if isempty(sorted)
54+
@info "No allocations detected using Profile.Allocs.@profile"
55+
else
56+
sorted_str = join(sorted, "\n\n")
57+
@error sorted_str
58+
# largest allocation
59+
trace = sorted[end].stacktrace
60+
@error join(trace, "\n")
61+
end
5862
Profile.clear()
5963
TT.@test trail.allocs <= min_allocs
6064
end

0 commit comments

Comments
 (0)