Cargando…

Clojure high performance programming : understand performance aspects and write high performance code with Clojure /

This is a short, practical guide that will teach you everything you need to know to start writing high performance Clojure code. 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 wi...

Descripción completa

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Kumar, Shantanu
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Birmingham : Packt Publishing, 2013.
Colección:Community experience distilled.
Temas:
Acceso en línea:Texto completo
Tabla de Contenidos:
  • Cover; Copyright; Credits; About the Author; Acknowledgments; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1:Performance by Design; Use-case classification; User facing software; Computational and data-processing tasks; CPU bound; Memory bound; Cache bound; Input/Output (I/O) bound; Online transaction processing (OLTP); Online analytical processing (OLAP); Batch processing; Structured approach to performance; Performance vocabulary; Latency; Throughput; Bandwidth; Baseline and benchmark; Profiling; Performance optimization; Concurrency and parallelism.
  • Resource utilizationWorkload; Latency numbers 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 less-used data structures; Complexity guarantee; Concatenation of persistent data structures; Sequences and laziness; Laziness; Laziness in data structure operations; Constructing lazy sequences; Transients; Fast repetition; Performance miscellanea; Disabling assertions in production; Destructuring.
  • Recursion and tail-call optimization (TCO)Premature end in reduce; Multimethods versus protocols; Inlining; Summary; Chapter 3:Leaning on Java; Inspect the equivalent Java source for Clojure code; Create a new project; Compile Clojure sources into Java bytecode; Decompile the .class files into Java source; Numerics, boxing, and primitives; Arrays; Reflection and type hints; Array of primitives; Primitives; Macros and metadata; Miscellaneous; Using array/numeric libraries for efficiency; HipHip; primitive-math; Resorting to Java and native code; Proteus
  • mutable locals in Clojure; Summary.
  • Chapter 4:Host PerformanceThe hardware; Processors; Branch prediction; Instruction scheduling; Threads and cores; Memory systems; Cache; Interconnect; Storage and networking; The Java Virtual Machine; The just-in-time (JIT) compiler; Memory organization; HotSpot heap and garbage collection; Measuring memory (heap/stack) usage; Measuring latency with Criterium; Criterium and Leiningen; Summary; Chapter 5:Concurrency; Low-level concurrency; Hardware memory barrier instructions; Java support and its Clojure equivalent; Atomic updates and state; Atomic updates in Java.
  • Clojure's support for atomic updatesAsynchronous agents and state; Asynchrony, queuing, and error handling; Why use agents?; Nesting; Coordinated transactional ref and state; Ref characteristics; Ref history and in-transaction deref operations; Transaction retries and barging; Upping transaction consistency with ensure; Fewer transaction retries with commutative operations; Agents can participate in transactions; Nested transactions; Performance considerations; Dynamic var binding and state; Validating and watching the reference types; Java concurrent data structures; Concurrent maps.