Book Image

Clojure High Performance Programming, Second Edition - Second Edition

By : Shantanu Kumar
Book Image

Clojure High Performance Programming, Second Edition - Second Edition

By: Shantanu Kumar

Overview of this book

Table of Contents (15 chapters)
Clojure High Performance Programming Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Identifying performance bottlenecks


We discussed in previous chapters that random performance tuning of code rarely works, because we may not be tuning in the right place. It is crucial to find the performance bottlenecks before we can tune those areas in the code. Upon finding the bottleneck, we can experiment with alternate solutions around it. In this section we will look into finding the bottlenecks.

Latency bottlenecks in Clojure code

Latency is the starting, and the most obvious, metric to drill-down in order to find bottlenecks. For Clojure code, we observed in Chapter 6, Measuring Performance that code profiling tools can help us find the areas of bottleneck. Profilers are, of course, very useful. Once you discover hotspots via profilers, you may find ways to tune those for latency to a certain extent.

Most profilers work on aggregates, a batch of runs, ranking the hotspots in code by resources consumed. However, often the opportunity to tune latency lies in the long tail that may not...