Profiling
Program profiling is the measurement and analysis of software execution behavior and resource use to characterize performance and identify bottlenecks.
Troubleshooting Java, Second Edition
Profiling is the measurement or recording of program execution to identify which code runs and how resources are used.
- How it is used
- Deploys execution measurement to locate performance, resource-consumption, concurrency, memory, and database-query problems.
- How deep it goes
- Explains sampling, CPU and memory monitoring, targeted instrumentation, invocation counts, SQL interception, and stack traces without covering profiler internals.
- Examples
- Uses VisualVM displays, unsynchronized producer-consumer threads, repeated JDBC queries, generated cross joins, and Product object allocation.
- What you can do after
- Diagnose bottlenecks, abnormal resource use, repeated queries, generated SQL errors, and allocation sources with VisualVM profiling.
Read how Troubleshooting Java, Second Edition explains profiling →
Troubleshooting Java: Read, debug, and optimize JVM applications
The practice of gathering information about a program's execution to understand its performance or behavior.
- How it is used
- Uses profiling to investigate unfamiliar execution paths, latency, database activity, and memory allocation.
- How deep it goes
- Walks through sampling, scoped instrumentation, and result interpretation, including JDBC interception and allocation stack traces.
- Examples
- Investigates a delayed endpoint, repeated product queries, and an endpoint that allocates many objects.
- What you can do after
- Diagnose latency, repeated SQL queries, and memory allocation problems using VisualVM.
Read how Troubleshooting Java: Read, debug, and optimize JVM applications explains profiling →
Fast Python: High performance techniques for large datasets
- How it is used
- Locates performance bottlenecks empirically before choosing optimizations for data-processing workloads.
- How deep it goes
- Develops a function-to-line profiling workflow, including trace interpretation, visualization, tool overhead and GPU-specific measurement.
- Examples
- Profiles climate-station downloads and distance calculations, then examines GPU Mandelbrot execution and data transfers.
- What you can do after
- Apply profiling via cProfile, SnakeViz, line_profiler, CuPy timing, and Nsight Systems to investigate execution costs.
Read how Fast Python: High performance techniques for large datasets explains profiling →
Advanced Algorithms and Data Structures
Profiling is the measurement of a program's runtime behavior, such as execution time and resource consumption, to identify performance characteristics.
- How it is used
- Guides performance decisions when implementation overhead, input distribution, or tunable data-structure parameters make asymptotic analysis insufficient.
- How deep it goes
- Defines profiling and develops a workflow from high-level timing to workload-specific CPU and memory comparisons, without detailing profiler configuration.
- Examples
- Compares Huffman encoding with d-ary heaps and profiles tree height, CPU time, and memory under different key distributions.
- What you can do after
- Evaluate/understand implementation trade-offs by profiling critical paths on representative inputs before choosing a parameter or data structure.
Read how Advanced Algorithms and Data Structures explains profiling →
100 Go Mistakes and How to Avoid Them
Profiling is the measurement of a program's runtime behavior and resource consumption to identify performance characteristics and bottlenecks.
- How it is used
- Uses profiling to identify performance issues, contention, and possible memory leaks before choosing optimizations.
- How deep it goes
- Explains profile types, pprof activation, CPU sampling defaults, and benchmark capture, then contrasts profiling with execution tracing.
- Examples
- Uses an HTTP pprof server and benchmark profile commands to demonstrate capture and inspection.
- What you can do after
- Apply it via pprof to capture profiles and investigate runtime behavior.
Read how 100 Go Mistakes and How to Avoid Them explains profiling →
Cloud Observability in Action
Profiling is the collection and analysis of measurements describing a program's execution behavior, resource usage, or function activity.
- How it is used
- Uses numerical execution evidence to troubleshoot services, optimize performance, and assess resource effects of code changes.
- How deep it goes
- Explains profile types, pprof collection, interactive analysis, and Parca usage, while stopping short of detailed pprof interpretation.
- Examples
- Uses Go pprof, CPU and goroutine profiles, cumulative function tables, and Parca profiling of an OpenTelemetry collector.
- What you can do after
- Diagnose/debug with it by locating costly functions and comparing service performance or resource usage across versions.
CUDA for LLMs
Profiling is the measurement of program execution behavior to identify resource usage and performance bottlenecks.
- How it is used
- Guides targeted GPU kernel optimization and checks whether local improvements matter to the complete inference workload.
- How deep it goes
- Details a profiling loop, tool selection, kernel metrics, bottleneck interpretation, and progressive measurement; treats application timelines separately from kernel analysis.
- Examples
- Compares naive and coalesced GEMV, profiles softmax parallelism, and traces GEMM optimization at realistic matrix sizes.
- What you can do after
- Diagnoses GPU bottlenecks with Nsight Systems and Nsight Compute, then measures targeted changes and end-to-end latency.
Starting Data Analytics with Generative AI and Python
Profiling is the systematic measurement of a program or system's resource usage and execution behavior to identify performance characteristics.
- How it is used
- Guides performance analysis by locating resource-intensive code and comparing system behavior before and after changes.
- How deep it goes
- Explains collected measurements and a repeated execution-time procedure, while stopping short of detailed profiling-tool internals.
- Examples
- Measures bootstrap confidence-interval calculations across sampled DataFrame sizes and plots execution time against input size.
- What you can do after
- Diagnose performance hot spots and evaluate optimization impact using repeated measurements under expected loads.
Read how Starting Data Analytics with Generative AI and Python explains profiling →
Fast by Default
Profiling is the measurement and analysis of a program's execution behavior and resource usage to reveal performance problems.
- How it is used
- Makes performance visible during development so branches can be checked before review and release.
- How deep it goes
- Explains a measure-investigate-fix-remeasure workflow and maps concerns to tools, but does not detail profiler internals.
- Examples
- Uses browser panels, a desktop photo-export queue, and profiling on flagship, mid-range, and budget devices.
- What you can do after
- Diagnose loading, runtime, memory, CPU, and rendering problems with browser tools, platform profilers, and device testing services.
Domain-Specific Small Language Models
The practice of collecting runtime measurements for model execution to identify bottlenecks and optimization opportunities.
- How it is used
- Identifies performance bottlenecks and optimization opportunities in ONNX model inference.
- How deep it goes
- Explains runtime capture and data aggregation through operator-level metrics and visualizations.
- Examples
- Uses a linear regression model and a diabetes dataset, then extends profiling analysis to LLMs.
- What you can do after
- Diagnose inference bottlenecks by profiling with ONNX Runtime and charting operator-level costs.
Read how Domain-Specific Small Language Models explains profiling →
Latency
CPU profiling is the measurement and attribution of processor execution time across program call paths.
- How it is used
- Uses CPU time attribution to locate high-cost call paths before optimizing benchmarked code.
- How deep it goes
- Explains flame-graph structure and interpretation, then stops short of broader profiling caveats or implementation internals.
- Examples
- Uses recursive, memoized, and iterative Fibonacci implementations with Criterion timings and a generated flame graph.
- What you can do after
- Diagnose expensive call paths using Criterion, pprof, profile intervals, and flame-graph widths.
Learn Haskell by Example
Profiling is the measurement and analysis of a program's runtime behavior and resource consumption to identify performance characteristics and bottlenecks.
- How it is used
- Diagnoses runtime bottlenecks in the ladder-game application before selecting performance changes.
- How deep it goes
- Descends from compilation and runtime commands to cost-center interpretation, then stops short of detailed profiling theory.
- Examples
- Uses ladder-game graph lookup, candidate computation, dictionary reading, and generated .prof reports as concrete profiling artifacts.
- What you can do after
- Diagnose performance bottlenecks with Stack profiling, RTS options, and cost-center reports, then evaluate targeted implementation changes.
Coding with AI
The measurement and analysis of a program's execution behavior, such as runtime and resource usage, to identify performance characteristics.
- How it is used
- Uses timing comparisons to check generated Python code and choose a more performant implementation.
- How deep it goes
- Demonstrates repeated function timing but stops short of broader profiling methodology or detailed performance internals.
- Examples
- Compares two punctuation-cleaning functions on the same text file using elapsed-time measurements.
- What you can do after
- Evaluate competing Python implementations and revise generated code using measured runtime evidence.
Embedded Software with Rust
Profiling is the measurement of a program's execution behavior to characterize its performance.
- How it is used
- Measures cycle-accurate execution time as one of four broad embedded debugging techniques.
- How deep it goes
- Explains DWT and SysTick timing, including counter width, wrap limits, and conflicts with existing SysTick use.
- Examples
- Times a loop of 10,000 no-op instructions using SysTick on a core without DWT.
- What you can do after
- Apply a SysTick timing pattern to measure a code region, accounting for a single counter wrap.
Machine Learning System Design
Profiling is the measurement and analysis of a program's runtime behavior and resource consumption to identify performance bottlenecks.
- How it is used
- Uses runtime measurement to choose promising optimization directions across the entire serving system.
- How deep it goes
- Measures pipeline performance and prioritizes bottlenecks, but does not detail profiling tools or measurement implementation.
- Examples
- Uses 200-millisecond latency analysis and a sequential multi-model pipeline where preprocessing dominated inference.
- What you can do after
- Diagnose/debug with profiling by locating bottlenecks and selecting optimizations with the greatest practical opportunity.
Read how Machine Learning System Design explains profiling →
Also covered in
- .NET in Action, Second Edition
- Grokking Data Structures
- MongoDB 8.0 in Action, Third Edition
- Practices of the Python Pro
- The Well-Grounded Python Developer: How the pros use Python and Flask
- Refactoring to Rust
- Writing for Developers: Blogs that get read
- Go by Example
- Software Engineering for Data ScientistsIn early access (MEAP)
What to know first
- performancePerformance is a measure of how effectively a person, process, model, or system achieves its objectives, including qualities such as output quality, speed, and resource efficiency.
- PythonPython is a high-level, general-purpose, dynamically typed programming language with readable syntax and support for multiple programming paradigms.
- RustRust is a statically typed systems programming language designed for performance, concurrency, and memory safety without requiring garbage collection.
- CPUA central processing unit (CPU) is a computer processor that executes program instructions and performs general-purpose computational operations.
Related concepts
- instrumentationequivalent to · Instrumentation is the addition or configuration of mechanisms in software or systems to observe, measure, or record execution and behavior.
- Nsight Computeuses · Nsight Compute is NVIDIA’s interactive profiler for analyzing and optimizing CUDA kernel performance and resource use.
- performancealternative to · Performance is a measure of how effectively a person, process, model, or system achieves its objectives, including qualities such as output quality, speed, and resource efficiency.
- cProfileuses · cProfile is a Python standard-library deterministic profiler that records function-call counts and execution-time statistics.
- memory boundmeasures · A workload is memory-bound when its performance is limited primarily by memory access or data-transfer capacity rather than computational throughput.
Questions about profiling
What is profiling?
Program profiling is the measurement and analysis of software execution behavior and resource use to characterize performance and identify bottlenecks.
Which Manning books explain profiling?
Troubleshooting Java, Second Edition, Troubleshooting Java: Read, debug, and optimize JVM applications, Fast Python: High performance techniques for large datasets, Advanced Algorithms and Data Structures, 100 Go Mistakes and How to Avoid Them, Cloud Observability in Action, CUDA for LLMs, Starting Data Analytics with Generative AI and Python and 7 more.
What should I know before learning profiling?
Manning books that teach profiling usually introduce performance, Python, Rust and CPU first.
What is the difference between profiling and performance?
Program profiling is the measurement and analysis of software execution behavior and resource use to characterize performance and identify bottlenecks. Performance is a measure of how effectively a person, process, model, or system achieves its objectives, including qualities such as output quality, speed, and resource efficiency.
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.














