Key Features Get the first book to explore Scala performance techniques in depth Real world inspired use cases illustrate and support the techniques studied and the language features This book is written by Vincent Theron and Michael Diamant, software engineers with several years of experience in the high frequency trading and programmatic advertising industries Book Description Scala is a statically and strongly typed language that blends functional and object oriented paradigms It has experienced growing popularity as an appealing and pragmatic choice to write production ready software in the functional paradigm Scala and the functional programming paradigm enable you to solve problems with less code and lower maintenance costs than the alternatives However, these gains can come at the cost of performance if you are not carefulScala High Performance Programming arms you with the knowledge you need to create performant Scala applications Starting with the basics of understanding how to define performance, we explore Scala s language features and functional programming techniques while keeping a close eye on performance throughout all the topicsWe introduce you as the newest software engineer at a fictitious financial trading company, named MV Trading As you learn new techniques and approaches to reduce latency and improve throughput, you ll apply them to MV Trading s business problems By the end of the book, you will be well prepared to write production ready, performant Scala software using the functional paradigm to solve real world problems What you will learn Analyze the performance of JVM applications by developing JMH benchmarks and profiling with Flight Recorder Discover use cases and performance tradeoffs of Scala language features, and eager and lazy collections Explore event sourcing to improve performance while working with stream processing pipelines Dive into asynchronous programming to extract performance on multicore systems using Scala Future and Scalaz Task Design distributed systems with conflict free replicated data types CRDTs to take advantage of eventual consistency without synchronization Understand the impact of queues on system performance and apply the Free monad to build systems robust to high levels of throughput About the Author Vincent Theron is a professional software engineer withyears of experience He discovered Scalayears ago and uses it to build highly scalable and reliable applications He designs software to solve business problems in various industries, including online gambling, financial trading, and, most recently, advertising He earned a master s degree in computer science and engineering from Universite Paris Est Marne la Vallee Vincent lives in the Boston area with his wife, his son, and two furry catsMichael Diamant is a professional software engineer and functional programming enthusiast He began his career infocused on Java and the object oriented programming paradigm After learning about Scala in , he has focused on using Scala and the functional programming paradigm to build software systems in the financial trading and advertising domains Michael is a graduate of Worcester Polytechnic Institute and lives in the Boston area Table of Contents The Road to Performance Measuring Performance on the JVM Unleashing Scala Performance Exploring the Collection API Lazy Collections and Event Sourcing This book contains a lot of great information for Scala programmers, but it s kind of buried in a frustrating reading experience.A lot of what you ll learn in this book is that many of the ways you use Scala normally are slow, I particularly enjoyed learning how Option, something I take completely for granted but has the potential to hurt performance in critical areas It s not just a complaint either, the author basically offers an alternative Option implementation that doesn t suffer from this This book contains a lot of great information for Scala programmers, but it s kind of buried in a frustrating reading experience.A lot of what you ll learn in this book is that many of the ways you use Scala normally are slow, I particularly enjoyed learning how Option, something I take completely for granted but has the potential to hurt performance in critical areas It s not just a complaint either, the author basically offers an alternative Option implementation that doesn t suffer from this and also, isn t as expressive, and is basically Java There are also some great sections about Free Monads and an absolutely fantastic coverage of the differences between Scala collection types and performance It s a lot deeper than you might think, it s not just oh this one is O n and this one is O logn , it s extremely detailed and informative.The main issues I have with the book are the writing style and the example used for illustration The writing style is fluffy and feels both padded and out of place The author basically takes the reader through almost a choose your own adventure story where you have started a new job, and you re talking to people to understand their performance issues, and helping them out They all have names like Dave from so and so department and it just feels totally unnecessary He gets in some cracks about you avoiding scrum masters to get real work done and how happy you re making this or that group and increasing the company s bottom line One one point, You double check with Gary to confirm that MVT strategies are thread safe He responds with a thumbs up emoji, which gives us the green light to parallelize execution of trading strategies It just feels so out of place, it kind of reads like the author wrote a dry, matter of fact book and then someone told him to make itof a story to keep readers engaged, and then he shoehorned all of this stuff in like it s The Phoenix Project It s kind of grating.The other gripe I ve got is that there s a single domain example used as a throughline through the entire book a high volume stock trading application I recognize that this is a fitting example because these kinds of applications really REALLY care about throughput, latency, and performance concerns I have a buddy who used to work at one of these places and they universally insist on using C with a lot of assembly callouts to get nanosecond improvements However, if you basically know fuck all about the stock market, a lot of the terminology and domain specifics might go over your head, and there s little to no attempt to explain any of it as the author assumes a base level of familiarity with these concepts This is probably a personal failing on my part because I hate the stock market and I don t mess around with it much, but I found myself occasionally struggling to understand exactly how the domain worked, and since it s critical through the ENTIRE book, this affects the whole reading.This book is definitely worth skimming, but I m not sure if it s worth a full sit down read I think the sections can largely be read independently, they rarely build on each other so it s worth going through and picking up the areas where you re particularly interested in performance If you do Scala full time, it s definitely worth flipping through if only to find out what kinds of things to look out for, so that you can circle back to the book later on if you encounter particular performance issues I can only say that this book exceeded my expectations While it does not provide fundamentally new ideas it approaches the topic very systematically and you can tell that the authors have earned their scars by tuning real systems.This book puts you into the shoes of a developer that just arrived at her new job.The first day demands the first performance problem to solve and each following problem is presented in the same entertaining and engaging way.The reader is introduced to profiling and be I can only say that this book exceeded my expectations While it does not provide fundamentally new ideas it approaches the topic very systematically and you can tell that the authors have earned their scars by tuning real systems.This book puts you into the shoes of a developer that just arrived at her new job.The first day demands the first performance problem to solve and each following problem is presented in the same entertaining and engaging way.The reader is introduced to profiling and benchmarking, learns to generate and interprete decompiled byte code, consider allocation and specialisation Of course the Scala collection API is treated extensively providing a good refresher of functional data structures as well as laziness and streams in an event sourcing environment Finally the authors present futures, promises and tasks before they finish with the introduction of a distributed architecture leveraging CRDTs and the free monad and interpreter pattern to provide optimal solutions for different tradeoffs.The in depth treatment of each of these topics while strongly focusing on the functional subset of Scala makes this a valuable reference for every Scala programmer.Last but not least it is a fun book to read.I highly recommend it I found this very useful, interesting It summarizes very well the usual problems I was already familiar regarding Scala performance and he suggests viable alternatives, solutions.I have to admit the beginning was a bit slow for me, the second half of the book isenjoyable though I was reading that part with less interruptions It worth checking the last chapter too, it introduces interesting ideas.
- Kindle Edition
- 274 pages
- Scala High Performance Programming
- Vincent Theron
- 10 September 2019 Vincent Theron