Home Page Icon
Home Page
Table of Contents for
Hands-On High Performance with Go
Close
Hands-On High Performance with Go
by Bob Strecansky
Hands-On High Performance with Go
Title Page
Copyright and Credits
Hands-On High Performance with Go
Dedication
About Packt
Why subscribe?
Contributors
About the author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Code in Action
Download the color images
Conventions used
Get in touch
Reviews
Section 1: Learning about Performance in Go
Introduction to Performance in Go
Technical requirements
Understanding performance in computer science
A brief note on Big O notation
Methods to gauge long term performance
Optimization strategies overview
Optimization levels
A brief history of Go
The Go standard library
Go toolset
Benchmarking overview
The ideology behind Go performance
Goroutines – performance from the start
Channels – a typed conduit
C-comparable performance
Large-scale distributed systems
Summary
Data Structures and Algorithms
Understanding benchmarking
Benchmark execution
Real-world benchmarking
Introducing Big O notation
Practical Big O notation example
Data structure operations and time complexity
O(1) – constant time
O(log n) - logarithmic time
O(n) – linear time
O(n log n) – quasilinear time
O(n2) – quadratic time
O(2n) – exponential time
Understanding sort algorithms
Insertion sort
Heap sort
Merge sort
Quick sort
Understanding search algorithms
Linear search
Binary search
Exploring trees
Binary trees
Doubly linked list
Exploring queues
Common queuing functions
Common queuing patterns
Summary
Understanding Concurrency
Understanding closures
Anonymous functions
Anonymous functions with respect to closures
Closures for nesting and deferring work
HTTP handlers with closures
Exploring goroutines
The Go scheduler
Go scheduler goroutine internals
The M struct
The P struct
The G struct
Goroutines in action
Introducing channels
Channel internals
Buffered channels
Ranges over channels
Unbuffered channels
Selects
Introducing semaphores
Understanding WaitGroups
Iterators and the process of iteration
Briefing on generators
Summary
STL Algorithm Equivalents in Go
Understanding algorithms in the STL
Sort
Reverse
Min element and max element
Binary search
Understanding containers
Sequence containers
Array
Vector
Deque
List
Forward list
Container adapters
Queue
Priority queue
Stack
Associative containers
Set
Multiset
Map
Multimap
Understanding function objects
Functors
Iterators
Internal iterators
External iterators
Generators
Implicit Iterators
Summary
Matrix and Vector Computation in Go
Introducing Gonum and the Sparse library
Introducing BLAS
Introducing vectors
Vector computations
Introducing matrices
Matrix operations 
Matrix addition
A practical example (matrix subtraction)
Scalar multiplication
Scalar multiplication practical example
Matrix multiplication
Matrix multiplication practical example
Matrix transposition
Matrix transposition practical example
Understanding matrix structures
Dense matrices
Sparse matrices
DOK matrix
LIL matrix
COO matrix
CSR matrix
CSC matrix
Summary
Section 2: Applying Performance Concepts in Go
Composing Readable Go Code
Maintaining simplicity in Go
Maintaining readability in Go
Exploring packaging in Go
Package naming
Packaging layout
Internal packaging
Vendor directory
Go modules
Understanding naming in Go
Understanding formatting in Go
Briefing on interfaces in Go
Comprehending methods in Go
Comprehending inheritance in Go
Exploring reflection in Go
Types
Kinds
Values
Summary
Template Programming in Go
Understanding Go generate
Generated code for protobufs
Protobuf code results
The link toolchain
Introducing Cobra and Viper for configuration programming
Cobra/Viper resulting sets
Text templating
HTML templating
Exploring Sprig
String functions
String slice functions
Default functions
Summary
Memory Management in Go
Understanding Modern Computer Memory - A Primer
Allocating memory
Introducing VSZ and RSS
Understanding memory utilization
Go runtime memory allocation
Memory allocation primer
Memory object allocation
Briefing on limited memory situations
Summary
GPU Parallelization in Go
Cgo – writing C in Go
A simple Cgo example
GPU-accelerated computing – utilizing the hardware
CUDA – utilizing host processes
Docker for GPU-enabled programming
CUDA on GCP
Creating a VM with a GPU 
Install the CUDA driver
Install Docker CE on GCP
Installing NVIDIA Docker on GCP
Scripting it all together
CUDA – powering the program
Summary
Compile Time Evaluations in Go
Exploring the Go runtime
GODEBUG
GCTRACE
GOGC
GOMAXPROCS
GOTRACEBACK
Go build cache
Vendoring dependencies
Caching and vendoring improvements
Debug
PProf/race/trace
Understanding functions
KeepAlive
NumCPU
ReadMemStats
Summary
Section 3: Deploying, Monitoring, and Iterating on Go Programs with Performance in Mind
Building and Deploying Go Code
Building Go binaries
Go build – building your Go code
Build flags
Build information
Compiler and linker flags
Build constraints
Filename conventions
Go clean – cleaning your build directory
Retrieving package dependencies with go get and go mod
Go list
Go run – executing your packages
Go install – installing your binaries
Building Go binaries with Docker
Summary
Profiling Go Code
Understanding profiling
Exploring instrumentation methodologies
Implementing profiling with go test
Manually instrumenting profiling in code
Profiling running service code
Briefing on CPU profiling
Briefing on memory profiling
Extended capabilities with upstream pprof
Comparing multiple profiles
Interpreting flame graphs within pprof
Detecting memory leaks in Go
Summary
Tracing Go Code
Implementing tracing instrumentation
Understanding the tracing format
Understanding trace collection
Movement in the tracing window
Exploring pprof-like traces
Go distributed tracing
Implementing OpenCensus for your application
Summary
Clusters and Job Queues
Clustering in Go
K-nearest neighbors
K-means clustering
Exploring job queues in Go
Goroutines as job queues
Buffered channels as job queues
Integrating job queues
Kafka
RabbitMQ
Summary
Comparing Code Quality Across Versions
Go Prometheus exporter – exporting data from your Go application
APM – watching your distributed system performance
Google Cloud environment setup
Google Cloud Trace code
SLIs and SLOs – setting goals
Measuring traffic
Measuring latency
Measuring errors
Measuring saturation
Grafana
Logging – keeping track of your data
Summary
Other Books You May Enjoy
Leave a review - let other readers know what you think
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Next
Next Chapter
Title Page
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset