liveBook · Manning

Profiling

As explained in Machine Learning System Design

Profiling is the measurement and analysis of a program's runtime behavior and resource consumption to identify performance bottlenecks.

Profiling measures system performance to reveal bottlenecks before optimization. It applies across the whole serving pipeline, not only to the model. section 15.4.1

Use profiling to make optimization decisions deliberately:

  • Measure each stage, including model inference, data preprocessing, and network interactions. section 15.4.1
  • Target the most optimizable bottleneck, not automatically the slowest component. section 15.4.1
  • Test proposed techniques against measurements rather than assuming batching or model changes will help. section 15.4.1

Choosing preprocessing over model optimization

A 200 ms request spent 120 ms in an already highly optimized GPU model and 80 ms in arbitrary Python preprocessing. Optimizing preprocessing offered more opportunity. In another pipeline, inference consumed only 5% of runtime, so batching failed to help; preprocessing changes reduced latency by 40%. section 15.4.1

How Machine Learning System Design covers it

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.
How it connects
Connects profiling with latency, data preprocessing, network interactions, model optimization, GPU inference, and batch inference.

Also explained in

Compare how 11 books explain profiling →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning System Design. The section links point to the parts of the book it draws on.