views:

265

answers:

9

If I want to become a Performance Consultant for Java applications and systems, what are the main skills I need?

  • long experience with Java itself
  • using a Profiler (or StackShots)
  • database knowledge (to avoid/detect common performance mistakes : indexes...)
  • Caching library
  • Java concurrency

Do you agree on the importance of these?
What else would you add?


UPDATED from answers:

Additional Skills:

  • Garbage Collection, and tuning
  • efficient Java code
  • Design (high-level vision)
  • UI technologies (Javascript, DOM, CSS, Swing, SWT)
  • Networking understanding (also used for Ajax)
  • Algorithmics, Big O
  • Hardware understand for Scaling

Mindset (offered by several answers, although I didn't ask for it):

  • Analytical (really measure)
  • Pressure-resistant
  • People/Political skills
+1  A: 

I would add:

  • Be sceptical, even about the profiler results : use your brain, first.
  • Don't believe it until you see it.
  • Don't blame before you measure.
xtofl
I understand. But this relates more to a state of mind while you are doing it, than a real Skill. I guess I didn't make the distinction clear enough :-(
KLE
I would change the first to: "Be skeptical, even about your brain's results: use your profiler first.". There was a case in which I was able to guess the performance bottleneck without a profiler, but that was brain-dead simple. Usually the profiler surprises me, and it's right.
David Thornley
+1  A: 

Being able to speed up Java code. You'll most likely be called in to look at slow code, and you'll need to find and fix the slow portions. Can't speed it up, and you'll have angry clients, speed it up and everyone is happy. This could put you under some pressure to perform, if you like that kind of thing.

You could be called in to advise on designs. As a result, you'll need to know a lot of best practices, and have good design skills.

KM
Thanks. I understand. To name a Skill, would you say **"Pressure-oriented"**? Or a better word...
KLE
Also, you'll need a good pair of boots. There will be some really bad code you'll have to slog through!
KM
I incorporate these two ideas to the question.
KLE
+3  A: 

I think the most important skill is an analytical mind able to follow the evidence and not the "gut feel" and really break down and measure the issues.

After that, it would take some creative ways to understand measuring. When someone hires a performance consultant they are often stuck, which most likely means they have real users doing real things, which means Java won't be the only thing in the stack (as you noted databases, but there may be javascript and networking issues and who knows what else as well).

In addition to all of that, in terms of the laundry list, the big thing missing is Garbage Collection. Understanding how that works and how to tweak that is critical. Many cases will involve problems with stop-the-world garbage collection just stopping an important process for too long.

You really need to have an extensive toolkit of potential solutions, as each client will need different things. Some will need an object pool for their immutable objects, some will need to introduce immutable objects to reduce synchronization, some will need to introduce mutable objects to prevent excessive object creation, etc.. Performance is really a case by case thing, and you need to have a range of experience and knowledge to pull from to help with each case.

Yishai
+1  A: 

Also, there is a subfield of this that deals with GUI performance enhancements (many high-speed applications such as finance are written in things like Swing). That brings in a whole bunch of additional skills.

Uri
Interesting. Could you give some precisions?
KLE
In Swing (and AWT), the painting/invalidating/clipping models and the event dispatching mechanisms are generally poorly understood. Misuse can significantly reduce responsiveness and increase lag, flicker, etc. Companies that need high-speed UIs (e.g., for finance and for military uses) will often pay for people who can improve these things. I know that similar things exist in the game industry (though not for Java).
Uri
+1 Thanks for that nice input.
KLE
+1  A: 

A strong understanding of algorithms and Big O notation. If you spend 10 hours optimizing an O(n) algorithm when a O(logn) exists you are wasting your time. I would add BigO to your list.

Also, a good understanding of the relationship between memory and CPU. Often you can trade one for the other (i.e. caching).

reccles
I agree very strongly that you must have a great strength in algorithmic analysis, but big-oh is just the very beginning of that. Despite my agreement, I don't think your answer is worth the upvote.
San Jacinto
I don't really care so much about votes. I'm just saying I would be skeptical of any consultant who claimed to be a performance expert and couldn't tell me the difference between an ArrayList and a LinkedList using the appropriate BigO.
reccles
+1  A: 

What others said, plus this. It goes along with this and this and this.

Added: Understanding Big-O, JVMs, cacheing, behavior of DBs is all important. However, when it comes to identifying the problem, you can often find it easily and quickly by a very simple procedure not requiring any special tools. It involves taking several random stackshots and looking at each one carefully, not summarizing.

This refutes much common wisdom about profiling, as you can easily prove to yourself. The links above explain it at length.

Mike Dunlavey
This is a pretty crappy answer. Give a synopsis of the links in your answer.
San Jacinto
@San: Didn't like it, huh? OK, I'll say a little more. I do get a little tired of spelling it all out over and over.
Mike Dunlavey
Downvote taken away. As tired as you get about making an interesting point, a one-liner sentence goes a long way in helping someone who already has a lot to read and to consider when asking a question.
San Jacinto
+1 Thanks, I didn't consider this. I added it to my list.
KLE
+2  A: 

I think hardware is also important to understand (at least it's important in designing high performing databases). When do you need to throw more hardware at the issue and when do you need to fix the code and when do you need to do both.

As a consultant on these sorts of things you are going to need serious people/political skills. You will be interviewing and collecting data from the people who already tried to fix the performance problem and couldn't. Many of them will be unhappy a consultant was called in. You'll have to deal with their resistance. IF you are going to do this as a business of your own, you will also need good accounting knowledge (and a tax consultant) and sales skills. YOu will need speaking skills to presnt your service to potential customers.

Make sure not only to measure but to document what was tried and the difference in time. Keep your own records of such things in a database and pretty soon, you will have a way to see the most likely performance tunings to try based on hard data over many clients. Developing a knowledgebase program will help you immensely as time goes on.

I'd also invest in a set of books on database performance tuning (At least one for each of the major database backends as tuning is very database specific) and database design. I think you will be able to trace many, many performance problems to bad database design and lack of knowledge of how to write good SQL code that will perform well. Database performance tuning is way more extensive than knowing what indexes to create.

HLGEM
+1 Thanks, especially for Hardware and for Politics.
KLE
+1  A: 

I think that depending upon the particular client and problem at hand, you'll need to have excellent skills in algorithmic analysis and optimization. Is your problem at the math-algorithmic level, or is it at the Java-algorithmic level?

You'll also need to be very familiar with the implementations of JVM you'll be working with. Knowing the language and API isn't good enough: you'll have to know in intimate detail which language constructs to use in certain situations, and this can vary depending upon the specific JVM you are using. A profiler won't always reveal JVM-specific performance issues. As others have noted, the same JVM can behave differently on disparate harware.

San Jacinto
Accepted. Many answers were good, and useful, but I had to choose one ;-)
KLE
+1  A: 

Some general skill requirements can be found in The Art of Application Performance Testing. Skills I've found useful are:

  • Statistics - performance tests never return the exact same timings twice. You need to find out what the margin of error is in order to see if changes are statistically significant.
  • business analyst skills - you need to see what the end users are doing, what parts they feel are slow, and then build up test cases around those events. At the end of your performance improvements, the users should be able to notice the difference, and your test results should quantify this.
  • technology generalist - Performance problems can occur anywhere. You need to understand every bit of technology in the stack to be able to isolate the problem. Performance problems can be caused by latency, networks, database, and code. You may find developers have 4 GB of RAM on their boxes, and the data entry people who use the code have a 512 MB machine.

The advantage of being a consultant is you can take an end-to-end view. Developers probably know areas of their code which run slow, but it may not be significant to the total processing time. Yes, that ArrayList#contains call runs in O(n) time, but may only take a few ms on modern hardware.

brianegge