[][src]Crate puffin

Macros

current_file_name

Returns a shortened path to the current file.

current_function_name

Returns the name of the calling function without a long module path prefix.

profile_function

Automatically name the profiling scope based on function name. Example: profile_function!(); Overhead: around 210 ns on 2020 MacBook Pro

profile_function_data

Automatically name the profiling scope based on function name. Additionally provide some data (e.g. a mesh name) to help diagnose what was slow. Example: profile_function_data!(mesh_name); Overhead: around 210 ns on 2020 MacBook Pro

profile_scope

Profile the current scope with the given name (unique in the parent scope). Names should be descriptive, ASCII and without spaces. Example: profile_scope!("load_mesh"); Overhead: around 140 ns on 2020 MacBook Pro

profile_scope_data

Profile the current scope with the given name (unique in the parent scope). Names should be descriptive, ASCII and without spaces. Additionally provide some data (e.g. a mesh name) to help diagnose what was slow. Example: profile_scope_data!("load_mesh", mesh_name); Overhead: around 150 ns on 2020 MacBook Pro

Structs

FullProfileData

Collected profile data from many sources.

GlobalProfiler

Singleton. Collects profiling data from multiple threads.

MergePiece
MergeScope

An record of several sibling (or cousin) scopes.

ProfilerScope

Created by the puffin::profile*!(...) macros.

Reader
Record

Used when parsing a Stream.

Scope

Used when parsing a Stream.

Stream

Stream of profiling events from one thread.

ThreadInfo

Used to identify one source of profiling data.

ThreadProfiler

Collects profiling data for one thread

Enums

Error

Functions

are_scopes_on

Are the profiler scope macros turned on? This is false by default.

clean_function_name
global_reporter

Report a stream of profile data from a thread to the GlobalProfiler singleton.

merge_children_of_pieces
merge_top_scopes
now_ns

Returns monotonically increasing nanosecond count. It is undefined when now_ns()=0 is.

set_scopes_on

Turn on/off the profiler macros (profile_function, profile_scope etc). When off, these calls take only 1-2 ns to call (100x faster). This is false by default.

short_file_name

Removes long path prefix to focus on the last parts of the path (and the file name).

type_name_of

Type Definitions

NanoSecond

All times are expressed as integer nanoseconds since some event.

Result