From the course: Java Concurrency Troubleshooting: Latency and Throughput

So your Java application is slow - Java Tutorial

From the course: Java Concurrency Troubleshooting: Latency and Throughput

Start my 1-month free trial

So your Java application is slow

- [Instructor] This course will provide you the most benefit, if you already have Java programming experience, and you possess an understanding of what threads are. You don't need to be an expert in threads, multithreading or any special JVM tuning. I'm here to talk to you about how to diagnose, and possibly resolve multithreading problems after all, I'll be using a simple Java Application to illustrate some concepts in this course. This Application will scramble input text to generate anagrams. Rearrangements of the characters of the input text. I'm using this as an example because it incorporates a good mix of being straightforward and also some mildly exertive computing, in the form of using the Random class, and the ThreadLocalRandom class to generate random numbers. If you want to give you CPU a workout, try an operation that relies on entropy. I may refer to web services and microservices from time to time during this course, but you don't need any background in either of these at all. The tips and techniques we're about to look at, are all applicable to all Java Applications. On a final note, I'd like to pay homage to one of the most popular aphorisms in software engineering, popularized by one of the grandfathers of software engineering, Donald Knuth. You've probably heard it before. "Premature optimization is the root of all evil" and that's where many users of this excerpt stop. What many may not know, is the full quote from the man himself. Here it is, "We should forget about small efficiencies, "say about 97% of the time: "premature optimization is the root of all evil. "Yet we should not pass up our opportunities "in that critical 3%." See, the last sentence of that quote is almost always left out when Knuth is been quilted, it's a popular misconception that we're supposed to abandon any performance consideration while engineering software. What Donald Knuth is telling us here, is to not close our eyes to avoidable performance issues. Some of them rookie mistakes, some of them more complicated, but most of them are well-known easily preventable application bottlenecks. We should be performance minded through the life cycle of our engineering, without fixating on small, impossible to measure optimizations. So come with whatever Java knowledge and experience you have, and let's see how we can prevent and diagnose performance issues related to multithreading.

Contents