Clojure high performance programming : become an expert at writing fast and high performant code in Clojure 1.7.0

Saved in:
Bibliographic Details
Main Author Kumar, Shantanu
Format Electronic eBook
LanguageEnglish
Published Birmingham : Packt Publishing, 2015.
EditionSecond edition.
SeriesCommunity experience distilled.
Subjects
Online AccessFull text
ISBN9781785283642
1785283642
9781785287671
1785287672
Physical Description1 online resource (199 pages) : illustrations (some color).

Cover

Table of Contents:
  • Cover; Copyright; Credits; About the Author; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Performance by Design; Use case classification; The user-facing software; Computational and data-processing tasks; A CPU bound computation; A memory bound task; A cache bound task; An input/output bound task; Online transaction processing; Online analytical processing; Batch processing; A structured approach to the performance; The performance vocabulary; Latency; Throughput; Bandwidth; Baseline and benchmark; Profiling; Performance optimization
  • Concurrency and parallelismResource utilization; Workload; The latency numbers that every programmer should know; Summary; Chapter 2: Clojure Abstractions; Non-numeric scalars and interning; Identity, value, and epochal time model; Variables and mutation; Collection types; Persistent data structures; Constructing lesser-used data structures; Complexity guarantee; O(<7) implies near constant time; The concatenation of persistent data structures; Sequences and laziness; Laziness; Laziness in data structure operations; Constructing lazy sequences; Transducers; Performance characteristics
  • TransientsFast repetition; Performance miscellanea; Disabling assertions in production; Destructuring; Recursion and tail-call optimization (TCO); Premature end of iteration; Multimethods versus protocols; Inlining; Summary; Chapter 3: Leaning on Java; Inspecting the equivalent Java source for Clojure code; Creating a new project; Compiling the Clojure sources into Java bytecode; Decompiling the .class files into Java source; Compiling the Clojure source without locals clearing; Numerics, boxing, and primitives; Arrays; Reflection and type hints; An array of primitives; Primitives
  • Macros and metadataString concatenation; Miscellaneous; Using array/numeric libraries for efficiency; HipHip; primitive-math; Detecting boxed math; Resorting to Java and native code; Proteus
  • mutable locals in Clojure; Summary; Chapter 4: Host Performance; The hardware; Processors; Branch prediction; Instruction scheduling; Threads and cores; Memory systems; Cache; Interconnect; Storage and networking; The Java Virtual Machine; The just-in-time compiler; Memory organization; HotSpot heap and garbage collection; Measuring memory (heap/stack) usage; Determining program workload type
  • Tackling memory inefficiencyMeasuring latency with Criterium; Criterium and Leiningen; Summary; Chapter 5: Concurrency; Low-level concurrency; Hardware memory barrier (fence) instructions; Java support and the Clojure equivalent; Atomic updates and state; Atomic updates in Java; Clojure's support for atomic updates; Faster writes with atom striping; Asynchronous agents and state; Asynchrony, queueing, and error handling; Why you should use agents; Nesting; Coordinated transactional ref and state; Ref characteristics; Ref history and in-transaction deref operations