Browse Clojure Foundations for Java Developers

Optimizing Function Calls

Reduce reflection and boxing in hot paths while keeping the rest of the code idiomatic.

Function calls in Clojure are fast enough for most code, but “hot loops” can expose costs you rarely think about in day-to-day programming: reflection, boxing, and dispatch choices that prevent primitive math.

This section shows how to find the places where call overhead matters, and how to apply targeted techniques (reflection warnings, type hints, and simpler loop shapes) without turning your whole codebase into low-level Java.

The goal is to keep optimization work narrow, reviewable, and justified by measurements.

In this section

Revised on Friday, April 24, 2026