O'Reilly logo

Clojure High Performance Programming by Shantanu Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Precomputing and caching

While processing data, we usually come across instances where a few common computation steps precede several kinds of subsequent steps. That is to say some amount of computation is common and the remaining is different. For high latency common computations (I/O to access the data and memory/CPU to process it), it makes a lot of sense to compute them once and then store them in a digest form. Then, the subsequent steps can simply use the digest data and proceed from that point onwards, thus resulting in reduced overall latency. This is also known as staging of semi-computed data, and it is a common technique to optimize processing of nontrivial amount of data.

Clojure has decent support for caching. The built-in clojure.core ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required