Free Sample
+ Collection
Code Files

Clojure High Performance Programming

Starting
Shantanu Kumar

Written for intermediate Clojure developers, this compact guide will raise your expertise several notches. It tackles all the fundamentals of analyzing and optimizing performance in clear, logical chapters.
$20.99
$34.99
RRP $20.99
RRP $34.99
eBook
Print + eBook

Want this title & more?

$16.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781782165606
Paperback152 pages

About This Book

  • See how the hardware and the JVM impact performance
  • Learn which Java features to use with Clojure, and how
  • Deep dive into Clojure's concurrency and state primitives
  • Discover how to design Clojure programs for performance

Who This Book Is For

This book is ideal for intermediate Clojure developers who are looking to get a good grip on how to achieve optimum performance. You should already have some experience with Clojure and it would help if you already know a little bit of Java. Knowledge of performance analysis and engineering is not required. For hands-on practice, you should have access to Clojure REPL with Leiningen.

Table of Contents

Chapter 1: Performance by Design
Use case classification
Performance vocabulary
Latency numbers every programmer should know
Summary
Chapter 2: Clojure Abstractions
Non-numeric scalars and interning
Identity, value, and epochal time model
Persistent data structures
Sequences and laziness
Transients
Performance miscellanea
Summary
Chapter 3: Leaning on Java
Inspect the equivalent Java source for Clojure code
Numerics, boxing, and primitives
Arrays
Reflection and type hints
Using array/numeric libraries for efficiency
Resorting to Java and native code
Summary
Chapter 4: Host Performance
The hardware
The Java Virtual Machine
Measuring latency with Criterium
Summary
Chapter 5: Concurrency
Low-level concurrency
Atomic updates and state
Asynchronous agents and state
Coordinated transactional ref and state
Dynamic var binding and state
Validating and watching the reference types
Java concurrent data structures
Concurrency with threads

Clojure parallelization and the JVM
Parallelism with reducers
Summary
Chapter 6: Optimizing Performance
A tiny statistics terminology primer
Performance testing
Performance monitoring
Profiling
Performance tuning
Summary
Chapter 7: Application Performance
Data sizing
Resource pooling
I/O batching and throttling
Precomputing and caching
Concurrent pipelines
Applying back pressure
Performance and queuing theory
Summary

What You Will Learn

  • Learn techniques for achieving numerical performance in Clojure
  • Use Java features in Clojure code for performance
  • Avoid reflection and boxing with type hints
  • Analyze latency using the Criterium library
  • Understand Clojure's concurrency and state-management primitives in depth
  • Explore how to design Clojure applications for better performance

In Detail

Clojure is a young, dynamic, functional programming language that runs on the Java Virtual Machine. It is built with performance, pragmatism, and simplicity in mind. Like most general purpose languages, Clojure’s features have different performance characteristics that one should know in order to write high performance code.

Clojure High Performance Programming is a practical, to-the-point guide that shows you how to evaluate the performance implications of different Clojure abstractions, learn about their underpinnings, and apply the right approach for optimum performance in real-world programs.

This book discusses the Clojure language in the light of performance factors that you can exploit in your own code.

You will also learn about hardware and JVM internals that also impact Clojure’s performance. Key features include performance vocabulary, performance analysis, optimization techniques, and how to apply these to your programs. You will also find detailed information on Clojure's concurrency, state-management, and parallelization primitives.

This book is your key to writing high performance Clojure code using the right abstraction, in the right place, using the right technique.

Authors

Read More