Clojure High Performance JVM Programming 1st Edition by Eduardo Diaz, Shantanu Kumar, Akhil Wali – Ebook PDF Instant Download/Delivery: 1787129594, 9781787129597
Full download Clojure High Performance JVM Programming 1st Edition after payment

Product details:
ISBN 10: 1787129594
ISBN 13: 9781787129597
Author: Eduardo Diaz, Shantanu Kumar, Akhil Wali
Clojure High Performance JVM Programming 1st Table of contents:
1. Module 1
1. Getting Started with Clojure
Getting to know Clojure
Installing Leiningen
Using a REPL
The nREPL protocol
Hello world
REPL utilities and conventions
Creating a new project
Project structure
Creating a standalone app
Using Cursive Clojure
Installing Cursive Clojure
Getting started with Clojure code and data
Lists in Clojure
Operations in Clojure
Functions in Clojure
Clojure’s data types
Scalars
Collection data types
Summary
2. Namespaces, Packages, and Tests
Namespaces in Clojure
Packages in Clojure
The classpath and the classloader
Back to Clojure namespaces
Playing with namespaces
Creating a new namespace
Working with namespaces on the REPL
Testing in Clojure
Testing from the command line
Testing in IntelliJ
Summary
3. Interacting with Java
Using Maven dependencies
Clojure interop syntax
Creating an object
Calling an instance method
Calling a static method or function
Accessing inner classes
Writing a simple image namespace
Writing the tests
The let statement
Destructuring in Clojure
Sequential destructuring
Associative destructuring
Exposing your code to Java
Testing from Groovy
Proxy and reify
Summary
4. Collections and Functional Programming
Basics of functional programming
Persistent collections
Types of collections in Clojure
The sequence abstraction
Specific collection types in Clojure
Vectors
Lists
Maps
Sorted maps and hash maps
Common properties
Sets
Sorted sets and hash sets
Common properties
Union, difference, and intersection
Applying functional programming to collections
The imperative programming model
The functional paradigm
Functional programming and immutability
Laziness
Summary
5. Multimethods and Protocols
Polymorphism in Java
Multimethods in Clojure
Keyword hierarchies
isa?
parents
descendants
underive
A la carte dispatch functions
Protocols in Clojure
Records in Clojure
Summary
6. Concurrency
Using your Java knowledge
The Clojure model of state and identity
Promises
Pulsar and lightweight threads
Futures
Software transactional memory and refs
Atoms
Agents
Validators
Watchers
core.async
Why lightweight threads?
Goblocks
Channels
Transducers
Summary
7. Macros in Clojure
Lisp’s foundational ideas
Macros as code modification tools
Modifying code in Java
Modifying code in Groovy
The @ToString annotation
The @TupleConstructor annotation
The @Slf4j annotation
Writing your first macro
Debugging your first macro
Quote, syntax quote, and unquoting
Unquote splicing
gensym
Macros in the real world
References
Summary
2. Module 2
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 parallelism
Resource utilization
Workload
The latency numbers that every programmer should know
Summary
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
Custom chunking
Macros and closures
Transducers
Performance characteristics
Transients
Fast repetition
Performance miscellanea
Disabling assertions in production
Destructuring
Recursion and tail-call optimization (TCO)
Premature end of iteration
Multimethods versus protocols
Inlining
Summary
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 metadata
String 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
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 inefficiency
Measuring latency with Criterium
Criterium and Leiningen
Summary
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
Transaction retries and barging
Upping transaction consistency with ensure
Lesser 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
Concurrent queues
Clojure support for concurrent queues
Concurrency with threads
JVM support for threads
Thread pools in the JVM
Clojure concurrency support
Future
Promise
Clojure parallelization and the JVM
Moore’s law
Amdahl’s law
Universal Scalability Law
Clojure support for parallelization
pmap
pcalls
pvalues
Java 7’s fork/join framework
Parallelism with reducers
Reducible, reducer function, reduction transformation
Realizing reducible collections
Foldable collections and parallelism
Summary
6. Measuring Performance
Performance measurement and statistics
A tiny statistics terminology primer
Median, first quartile, third quartile
Percentile
Variance and standard deviation
Understanding Criterium output
Guided performance objectives
Performance testing
The test environment
What to test
Measuring latency
Comparative latency measurement
Latency measurement under concurrency
Measuring throughput
Average throughput test
The load, stress, and endurance tests
Performance monitoring
Monitoring through logs
Ring (web) monitoring
Introspection
JVM instrumentation via JMX
Profiling
OS and CPU/cache-level profiling
I/O profiling
Summary
7. Performance Optimization
Project setup
Software versions
Leiningen project.clj configuration
Enable reflection warning
Enable optimized JVM options when benchmarking
Distinguish between initialization and runtime
Identifying performance bottlenecks
Latency bottlenecks in Clojure code
Measure only when it is hot
Garbage collection bottlenecks
Threads waiting at GC safepoint
Using jstat to probe GC details
Inspecting generated bytecode for Clojure source
Throughput bottlenecks
Profiling code with VisualVM
The Monitor tab
The Threads tab
The Sampler tab
Setting the thread name
The Profiler tab
The Visual GC tab
The Alternate profilers
Performance tuning
Tuning Clojure code
CPU/cache bound
Memory bound
Multi-threaded
I/O bound
JVM tuning
Back pressure
Summary
8. Application Performance
Choosing libraries
Making a choice via benchmarks
Web servers
Web routing libraries
Data serialization
JSON serialization
JDBC
Logging
Why SLF4J/LogBack?
The setup
Dependencies
The logback configuration file
Optimization
Data sizing
Reduced serialization
Chunking to reduce memory pressure
Sizing for file/network operations
Sizing for JDBC query results
Resource pooling
JDBC resource pooling
I/O batching and throttling
JDBC batch operations
Batch support at API level
Throttling requests to services
Precomputing and caching
Concurrent pipelines
Distributed pipelines
Applying back pressure
Thread pool queues
Servlet containers such as Tomcat and Jetty
HTTP Kit
Aleph
Performance and queueing theory
Little’s law
Performance tuning with respect to Little’s law
Summary
3. Module 3
1. Working with Sequences and Patterns
Defining recursive functions
Thinking in sequences
Using the seq library
Creating sequences
Transforming sequences
Filtering sequences
Lazy sequences
Using zippers
Working with pattern matching
Summary
2. Orchestrating Concurrency and Parallelism
Managing concurrent tasks
Using delays
Using futures and promises
Managing state
Using vars
Using refs
Using atoms
Using agents
Executing tasks in parallel
Controlling parallelism with thread pools
Summary
3. Parallelization Using Reducers
Using reduce to transform collections
What’s wrong with sequences?
Introducing reducers
Using fold to parallelize collections
Processing data with reducers
Summary
4. Metaprogramming with Macros
Understanding the reader
Reading and evaluating code
Quoting and unquoting code
Transforming code
Expanding macros
Creating macros
Encapsulating patterns in macros
Using reader conditionals
Avoiding macros
Summary
5. Composing Transducers
Understanding transducers
Producing results from transducers
Comparing transducers and reducers
Transducers in action
Managing volatile references
Creating transducers
Summary
6. Exploring Category Theory
Demystifying category theory
Using monoids
Using functors
Using applicative functors
Using monads
Summary
7. Programming with Logic
Diving into logic programming
Solving logical relations
Combining logical relations
Thinking in logical relations
Solving the n-queens problem
Solving a Sudoku puzzle
Summary
8. Leveraging Asynchronous Tasks
Using channels
Customizing channels
Connecting channels
Revisiting the dining philosophers problem
Using actors
Creating actors
Passing messages between actors
Handling errors with actors
Managing state with actors
Comparing processes and actors
Summary
9. Reactive Programming
Reactive programming with fibers and dataflow variables
Using Reactive Extensions
Using functional reactive programming
Building reactive user interfaces
Introducing Om
Summary
People also search for Clojure High Performance JVM Programming 1st:
clojure high performance jvm programming
clojure performance vs java
clojure performance benchmark
clojure performance
clojure high performance
Tags: Eduardo Diaz, Shantanu Kumar, Akhil Wali, Clojure, JVM Programming


