hot path

Code that runs very often, such as on every request, where small costs add up.

In more detail

Small costs such as extra allocations or logging add up there, so it is the first place to optimise after profiling. Code that rarely runs is seldom worth tuning.

Example

V8 counts how often functions run and optimises the hot ones first.

Related terms

Taught in

References