liveBook · Manning

Sample-based profiling

Sample-based profiling is a technique that periodically observes a running program to estimate the relative execution cost of its activities.

How 2 Manning books explain it

Fast by Default

A profiling technique that estimates execution-time distribution by periodically recording program execution state.

How it is used
Uses lightweight execution sampling to locate application hotspots before code review and during realistic user activity.
How deep it goes
Explains sampling, call-tree navigation, overhead tradeoffs, and timing interpretation, but defers exact call sequencing to trace profiling.
Examples
Uses mobile screen interactions, Android and iOS profilers, Python cProfile output, and a cumulative-time serialization example.
What you can do after
Diagnose hotspots by collecting representative samples, following heavy call paths, and distinguishing direct work from expensive callees.

Read how Fast by Default explains sample-based profiling →

JavaScript in Depth

The technique of periodically observing a running program to estimate the relative cost of its execution activities.

How it is used
Estimates where a running JavaScript program spends execution time during CPU-performance investigation.
How deep it goes
Explains periodic stack sampling, aggregation, statistical interpretation, and runtime-specific visibility limits.
Examples
Uses Node.js --prof collection, --prof-process conversion, and Chrome DevTools-compatible --cpu-prof output.
What you can do after
Diagnose/debug with Node.js profiling commands by collecting samples and reading aggregated function-time reports.

Read how JavaScript in Depth explains sample-based profiling →

Related concepts

Questions about sample-based profiling

What is sample-based profiling?

Sample-based profiling is a technique that periodically observes a running program to estimate the relative execution cost of its activities.

Which Manning books explain sample-based profiling?

Fast by Default and JavaScript in Depth.

What is the difference between sample-based profiling and trace-based profiling?

Sample-based profiling is a technique that periodically observes a running program to estimate the relative execution cost of its activities. Trace-based profiling records individual function calls and their sequence during program execution.

What is sample-based profiling a kind of?

Sample-based profiling is a kind of sampling. Sampling is a procedure for selecting items from a collection or generating outcomes from a probability distribution according to a specified rule.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.