Java performance tuning book

Top 5 Java Performance Tuning Books – Best of Lot, Must read

Why Java developer should read a book on Performance tuning? When I first faced this question long time back, I thought I will do it later, but I never get back to that for a long time. I realize my mistake of having lack of knowledge on performance measurement, tuning and finding bottleneck only when I faced serious performance and scalability issues on our mission critical server side financial application written in Java. It’s true that when you really need it you learn most, but those times are not the best time to learn fundamentals, in fact those times are to apply and correct your misunderstanding. This is why I am sharing these Java performance books to all Java programmers and suggesting them to take sometime and go through at-least one book in full. By the way these books are in addition to my 5 must read books for Java programmers. Remember knowledge of Performance tuning is one important aspect of Senior Java developers, and can separate you from crowd. Ever since Java was introduced, almost 20 years back, it has faced criticism on being slow and lacking performance. Today, I don’t think Java is anywhere behind in terms of performance to native languages. Given Java’s ability to natively compile hot code using JIT (Just in time Compiler), it is almost at par with native applications written in C and C++, but a lot can be done by following best practices, avoiding common performance pitfalls and using latest tools and techniques. In this article, I am going to introduce with five + one good books on Java performance, which will not only teach you what to measure, how to measure but also explains fundamentals and concept behind those issues. You will not only learn about System and JVM on which your Java application run but also how to to writer faster coding using Java API. So what are we waiting for, let’s begin our journey to land of great books on Java performance tuning.

Java_performance_the_definite_guide_Stock

In one word, this is currently THE best book on Java Performance tuning. Multiple reasons for that, one of them is, this is the most updated book, covers up-to Java 7 update 40. In order to learn performance tuning, you should know tools, process, options and most importantly avoiding common performance pitfalls. This book scores good on this point, it has chapter introducing all the tools, a Java performance engineer should be aware of, including the one which is added in Java 7u40, e.g. Flight Recorder and Java Mission Control. It also has good chapters on explaining various garbage collection algorithms e.g. Concurrent Mark Sweep (CMS) and G1 Garbage collector. You will learn how each of them works in different conditions, how to monitor them and how to tune them. It also include a full chapter on heap analysis and optimization. This will teach you common things like how to take heap dumps and histograms in Java, and then introduces many ways to decrease your heap memory footprint. It also has a chapter on JDBC and JPA performance. Key point it teaches you that how choosing the proper JDBC / JPA methods may far outweigh the gains from the SQL queries tuning. Similarly it has a complete chapter explaining about multi-threading issues, pitfalls and impact on performance. It includes advanced topics like ForkJoinPool, and Java 8 Streams. It also touch base on cost of synchronization and false sharing, tuning JVM threads e.g. thread stack size, configure biased locking, thread priorities and thread spinning. By the way best is yet to be introduced, what I I like most in this book is Chapter 12. This chapter presents some classic core Java tuning tips and their impact. This includes buffered I/O, class loading, random number generation, JNI, exceptions, String performance, logging, Java Collections API, Java 8 lambdas vs anonymous classes and finally Java 8 stream and multiple filter performance. This is actually the fist chapter I read and I fall in love with its content and style. If you like to quickly gauge the book by yourself, I suggest starting with this chapter. It also touch base on Java EE performance, explaining possible issues with XML and JSON parsing, and object serialization.

Читайте также:  Contacts

Java Performance

This was my favourite Java performance book from long time, until recently when I read Java Performance The Definitive Guide By Scott Oaks. This book is very much similar like the one which replaced it from top. It has chapters explaining on how to take measurements of performance, explaining tools necessary to measure CPU, Memory and IO. Chapters on explaining How Garbage collection works, different GC algorithms e.g. Serial vs Parallel Garbage collectors, Concurrent Mark Sweep collectors etc. Binu John and Charlie Hunt has done excellent job to how to construct experiments that identify opportunities for optimization, interpret the results, and take effective action. To give you some credibility and hint what you can expect in this book, Charlie Hunt is the JVM performance lead engineer at Oracle. He is responsible for improving the performance of the HotSpot JVM and Java SE class libraries. He has also been involved in improving the performance of the Oracle GlassFish and Oracle WebLogic Server and Binu John is a senior performance engineer at Ning, Inc., where he focuses on improving the performance and scalability of the Ning platform to support millions of page views per month. Before that, he spent more than a decade working on Java-related performance issues at Sun Microsystems, where he served on Sun’s Enterprise Java Performance team. If you haven’t read any book on Java performance tuning and want to build a good foundation on dealing with performance problems, this is the book to buy. It’s worth of every single penny spent.

System Performance Enterprise and the Cloud

Systems performance analysis is an important skill for all computer users, whether you’re trying to understand why your laptop is slow, or optimizing the performance of a large-scale production environment. It is the study of both operating system (kernel) and application performance, and this book will tell you all you need to know about Linux performance monitoring and tuning. Programmer starts with optimizing algorithms, data structure, JVM, Garbage collectors but they eventually reach to a point where System performances comes into play. You may want to know why disk operations were so quick on your development box, but became a major issue on the production box, how CPU caching affect so much to your application, how can you leverage L1, L2 and L3 Cache, and Physical memory available in your machine. In my opinion, this is the book for every programmer and not just for Java programmer. Knowing how your system work, how paging, swapping and virtual memory work , how CPU gets data from disk, how different kind of disk can make profound impact on IO bound Java applications is very important for any developer genuinely interested in performance tuning. I had often said, learn JVM but I can now say you must know your System well. Knowing operating system basics, system calls, memory, CPU, network and disk IO, caches will certainly goes long way and helps you to write high performance application in any programming language, including Java.

Читайте также:  Python имя запущенного скрипта

Java Performance Scalability Quantitative approach

Before Introducing the book, let me introduce the author, he is a PHD, works at Vmware and specialized in writing high performance and scalable enterprise Java applications, but I think he is more known for his work on Software Performance and Scalability: A Quantitative Approach. You can see this book a more specialized version of his earlier best seller. As name suggest this books is focused on performance and scalability of Java application. This book is good for Java developers, architects and even managers. It is divided in two main parts, first part deals with basics of Java performance and Scalability and second part presents practices to improve performance and scalability. The basics part contains four chapters each of them separately explores scalability of software programs, computer hardware, and Java Virtual Machine. Second part contains chapters exploring how going from 32-bit to 64-bit affect performance and scalability of Java application. Chapter 6 is probably the most important chapter which explains how to tune Java for best possible performance and scalability. It introduces methodologies, practices, tools and tuning Java application keeping scalability in mind. Chapter 7 is another important chapter which explains how design, algorithms and implementations affects performance and scalability of any Java application. It also covers how to perform bottleneck analysis. Good thing is that he explains all this with sample programs, so you can follow guidelines while reading. Overall its a very good and unique book for Java performance engineer, and if you love to read multiple books to gain insights, this is the one you can read along with Java Performance The Definitive Guide and System Performance : Enterprise and the Cloud.

The Well Grounded Java Developer

This is the bonus book for my readers, I won’t say this book only focuses on Java performance tuning but I would say this is the book every modern Java developer should have in his shelf. Ben Evans and Martjin Verburg doesn’t need any introduction. They are well known Java experts and founder of jClarity, which promises to solves performance problems in cloud environments. They have many years of experience in Java, which reflects in their book The Well-Grounded Java Developer: Vital techniques of Java 7 and polyglot programming. I first come across this books on 2012, and after reading sample chapters, I was convinced to buy this book. This is the must have book for modern day Java developer. It explains new changes on Java including those in JDK 7 e.g. try-with-resources, NIO2.0, and concurrency changes; but most importantly It explains why it is so expensive to add new features to the JVM. Adding new library extensions such as fork/join or syntactic sugar like switch-on-string is relatively easy, but adding a JVM instruction like invokedynamic is very costly. Probably the best thing about this book is that it doesn’t stop at Java, and go one step further to introduce modern day JVM language e.g. Scala, Clojure and Groovy. It touches functional programming with new JVM languages and modern approaches to test, build and contentious integration of Java applications.

That’s all on this list of good Java performance tuning books. I have recommended Effective Java a lot of time and as one must have book for Java developers, but same time I have also found that you should have a book dedicated to Java Performance tuning. After some years of work and experience in Java, you are bound to face performance challenges, and at this time you should at-least know fundamental, tools and process of finding bottleneck and improving performance of Java application. So, if you haven’t read any Java performance book, this is the time to read one.

Источник

Optimizing Java

Optimizing Java

Read it now on the O’Reilly learning platform with a 10-day free trial.

O’Reilly members get unlimited access to books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.

Book description

Performance tuning is an experimental science, but that doesn’t mean engineers should resort to guesswork and folklore to get the job done. Yet that’s often the case. With this practical book, intermediate to advanced Java technologists working with complex technology stacks will learn how to tune Java applications for performance using a quantitative, verifiable approach.

Most resources on performance tend to discuss the theory and internals of Java virtual machines, but this book focuses on the practicalities of performance tuning by examining a wide range of aspects. There are no simple recipes, tips and tricks, or algorithms to learn. Performance tuning is a process of defining and determining desired outcomes. And it requires diligence.

  • Learn how Java principles and technology make the best use of modern hardware and operating systems
  • Explore several performance tests and common anti-patterns that can vex your team
  • Understand the pitfalls of measuring Java performance numbers and the drawbacks of microbenchmarking
  • Dive into JVM garbage collection logging, monitoring, tuning, and tools
  • Explore JIT compilation and Java language performance techniques
  • Learn performance aspects of the Java Collections API and get an overview of Java concurrency

Источник

Оцените статью