You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: stdlib/Profile/src/Profile.jl
+18-1Lines changed: 18 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,24 @@
1
1
# This file is a part of Julia. License is MIT: https://julialang.org/license
2
2
3
3
"""
4
-
Profiling support, main entry point is the [`@profile`](@ref) macro.
4
+
Profile
5
+
6
+
Profiling support.
7
+
8
+
## CPU profiling
9
+
- `@profile foo()` to profile a specific call.
10
+
- `Profile.print()` to print the report.
11
+
- `Profile.clear()` to clear the buffer.
12
+
- Send a $(Sys.isbsd() ?"SIGINFO (ctrl-t)":"SIGUSR1") signal to the process to automatically trigger a profile and print.
13
+
14
+
## Memory profiling
15
+
- `Profile.Allocs.@profile [sample_rate=0.1] foo()` to sample allocations within a specific call. A sample rate of 1.0 will record everything; 0.0 will record nothing.
16
+
- `Profile.Allocs.print()` to print the report.
17
+
- `Profile.Allocs.clear()` to clear the buffer.
18
+
19
+
## Heap profiling
20
+
- `Profile.take_heap_snapshot()` to record a `.heapsnapshot` record of the heap.
21
+
- Set `JULIA_PROFILE_PEEK_HEAP_SNAPSHOT=true` to capture a heap snapshot when signal $(Sys.isbsd() ?"SIGINFO (ctrl-t)":"SIGUSR1") is sent.
0 commit comments