April 2006

More thoughts on “What is Performance?”

From the foreword of the 1989 Version of Tandem Computers “Introduction to Performance Analysis” manual:

“Do all things in moderation and nothing to excess”
- Aristotle
Magnitude and limits clearly have their place in performance analysis. Yet there is also the matter of confused perception that must be discussed: mainly performance concepts that appear intuitively valid on the surface but are sure to fail in the test of actual experience.
Performance Analysts will always benefit from periodic challenges no matter how rational or aesthetic they may appear. So maybe John Locke’s quote is appropriate ["God has not been so sparing of men to make them barely two-legged creatures, and left it to Aristotle to make them rational."] At any rate his attitude sparks a receptive chord. People almost always do seem to be the most irrational element of any performance review or analysis.
With this in mind performance analysis should advance simple, proven concepts that experience has shown to be effective. This calls for awareness of some obscure details, a fairly disciplined method and a certain amount of ordinary manual labor.

Performance Analysis should seek to define both the adequacy and limits of a system and also strive to obtain the most efficient use of a system. A comprehensive performance review should attempt to discover if the system usage occurs in a prudent (non-wasteful) manner and also determine if resources available can meet performance goals desired.

(all from the first page!)
And another tasty nugget from slightly later on:

“Concurrence is to performance potential what expandability is to capacity potential.” page 4

Yes! I would take it a step farther and add that “Concurrence and loose coupling is to performance potential what expandability is to capacity potential”. By keeping those layers seperate and distinct, you are freeing the code from the bounds of being in the same thread, the same process, the same machine. Layers and components can be completely seperated without the client code knowing about it. Very powerful stuff. There is a great section in Ship It! that talks about this concept further.

Agile
Books
General
Java
Performance
Software Development

Comments (0)

Permalink

What is Performance?

Matt Payne posted a link to a Sun Book called Java Platform Performance. Thanks Matt!

I have been thinking a lot about performance lately. More so than I have in about 5 years, actually. First it was the presentation I did for my consulting company, and now I will be giving some expanded presentations in the next few months that will require a bit more thought from me, as well as some performance related work on my current project.
So, when I saw Matt’s blog post, it was like “WooHoo!!! Yet more reading!!! Yay!!!” (thats sarcasm, btw), but I need to, so I started reading. I’m not too far into it yet, (I really hate HTML-Books, but that can wait for another post ;-) but didn’t need to go far before finding something interesting.

As they should, the authors start out by asking the simplist performance question to ask, and one of the morst difficult to answer. Ok, they are all difficult, but this one seems to be even trickier:

What it performance?

The reason this is so tricky is because of perspective. In the right crowds you can talk about Transactions-per-second, or millisecond costs (or or or). In others you can say “yes, its fast”. And I’ll just ignore marketing-based performance completely for the sake of not ranting.

This falls inline with what the authors say:

Before we can discuss how to improve performance, it’s necessary to define what performance is. This isn’t as simple as it sounds-people often mean very different things when they talk about performance. There are several aspects of performance, each of which contribute to the overall performance of an application.
Computers fascinate people with their ability to carry out tasks with blinding speed. When a computer, for whatever reason, doesn’t perform a task quickly, users are disappointed. Developers often use the terms “speed” and “performance” interchangeably. However, to understand the different types of problems that can be encountered, all of the different aspects of performance must be considered:

  • Computational performance
  • AM footprint
  • Startup time
  • Scalability
  • Perceived performance

These factors lay the foundation for a better understanding of the performance landscape. Some aspects of performance are primarily applicable to client-side systems, some to server-side systems, and some to both. Understanding how each factor can contribute to the performance characteristics of a system will help you analyze the performance of your own applications.

Fair enough, but I’m not satisfied.
Is there a general answer to this question?

Yes, I think we can come up with one. Lets first look at what characteristics make up Performance. “Whoa there, isn’t that the same thing as the first question?” Well, yes. But maybe breaking down the whole into smaller parts will allow us to find insight into the bigger question.

So, in my mind, Performance is made up of the following components or characteristics:
Measureable: there is no point in trying to make something faster, if you have no idea how fast it is now. You must be able to measure the output for meaningful data.

Has a Goal: there needs to be a focal point in your hunt for “Performance”. If you do not have something to look for, even something general, you will be looking at a big pile of measurements, with no idea where to start.

Limited: as with having the focused goal, you need to limit your search. It is far too easy to get caught up in what-if? games, or perhaps a little more common, have such a big a pile of measurement data to look at that you get lost trying to find your way to the restroom. Not a good thing.
Is this all of them? I’m not sure yet. So, at this point our answer is:

A focused look at a measurable aspect of a system* within a limited scope.
* system in this case could mean just about anything.
I used to have a job where I analyzed the performance of systems. Fortunately I worked with some people much smarter than me, and I learned a lot from them. One of the things I learned, came from our FAQ.

It depends.

It always depends. There are too many varables for anyone to keep straight everything involved in Performance., which is what the authors of the book are really trying to tell you. Lets make up an example not so far from the truth. Lets say you want to measure the general performance of your system, just to get a baseline. Where and when do you do this?

Unfortunately that is not an easy question to answer (see, told ya they are all hard!). Do you run the test on your production server? Probably not. Do you have an exact duplicate of your production environment (including configuration) that you could use? Very unlikely. So, you now have to take your measurements in some environment other than production and somehow extrapolate the findings from that into your production environment. So, how do you do that? Well, again a tricky answer. Do you trust the vendors information? Oh hell no (holding… back… rant…). If those numbers actually were correct, then somehow, somewhere, a performance engineer had a very impressive coup. So what do you do there? It depends. Ha!

And, so if you do by some miracle of executive foresight get the chance to do your testing in a production or near production environment, then what? You need to know when to test.

“Premature optimization is the root of all evil.”
- Hoare and Knuth [wikipedia]

Do you start testing right away, or after you are finished with development? Well, if you are an agilist, its an easy answer. The sooner you start performance testing, the better.

“But wait! Why would I want to do that right away, since you just quoted Hoare and Knuth (of all people!) on premature optimization being the root of all evil?!?!”

Who said anything about optimization? I said testing. BIG difference. What I would recommend is to find out what your performance targets are (that will have to be another post - sorry), and build into your Continuous Integration cycle a performance test, scheduled for once a day or once a week. You do have a continuous integration environment, don’t you? :-)

In this type of environment, as long as you are under your performance targets, you are in good shape. The moment you go over your targets, then you need to do some serious tuning of the system.

I will follow up on this essay at some point in the (hopefully near) future with more about finding those pesky performance targets and some more on performance in general.

Agile
General
Performance

Comments (0)

Permalink

The immediate benefits of Continuous Integration

I’ve been reading Ship It! off of my “Pragmatic Bookshelf” over the last week, and have picked up a number of great ideas. As I have gone through the book I have been dusting off the cobwebs and thinking about the projects I have been involved in over my career, and applying the candle of thought to them: what worked? what didn’t? what could I have done differently?

One of the things that I now look back on and realize I could have done better on was Continuous Integration. This is something that I’ve known about since 2001, when I first read Kent Beck’s seminal eXtreme Programming eXplained, but have only applied it in a couple projects, always as a Daily Build, not the usual as-fast-as-you-can-build-it velocity.

One thing that I noticed with the daily builds that both books talk about is the quicker turn-around for integration problems. We just didn’t have those silly “oops I forgot to check that file in a two weeks ago lets hope its still on my machine” problems.

So, it wouldn’t be worth thinking about all of those past projects without at least looking at a current project I’m working on. And who woulda thunk it: we have some issues. The one that leaped out at me first was that we have not had a clean build for as long as I can remember. And while my memory, could argueably be shot (just ask my wife after the next time I forget to take out the trash:-), I am pretty sure it has been at least a month since my sandbox did not have at least one compile error in it. I was just ignoring those pesky errors, as I knew so-and-so was in that code, and that it would be fixed eventually.

Reading the book helped kick me out of my complacency, and on Monday I took the first steps of bringing continuous integration to my dev team by downloading and setting up CruiseControl on my machine. Now, I have known about CC for a long time, but had not played with it before. It took about two hours to setup, split over Monday and Tuesday mornings. Cake. Buttery, Creamy Cake. If I had known just how easy it would be, I would have been using this tool for all of my previous projects. I will be from now on. Here’s why:

Tuesday morning I configured the script to start emailing the entire group. Of course, the first email everyone gets has a subject of “Build Failed!”. I sent out an email explaining that I had set it up for a 15 minute cycle, and that they (the rest of the team) would only see the “Build Failed”‘ messages, unless they desired to see the successful ones as well.

The most interesting response I got was that “It should be 2-3 hours, 15 minutes is not enough time for the developers to fix their bugs”. I kindly reminded him that compile errors are not bugs, and should not get into the build in the first place, but since we are all human, this just helps us catch those types of errors in about 15 minutes, versus trying to remember what we did yesterday or worse: last week.

The result:

Within one hour ALL of the compile errors were taken care of, and over the course of the rest of the week we only had a couple of incidents. I am really looking forward to seeing the benefits of a growing functional and unit test suites in conjunction with the continous build.

Agile
Books
General
Software Development

Comments (2)

Permalink

My current stack o’ readin’ (aka: I am NOT a fanboy, honest!)

One of the best things that the Omaha NoFluffJustStuff conference brought with it were the books.  As I stood there helping peddle the books, I picked up a few that I have been meaning to read for a while now, and just have not taken the time to get.

I picked up four good books while at NFJS: (In the order I intend to read them)

Ship It!

This book looks so good.  I was nodding my head just skimming the section titles.

My Job Went To India

I have been dying to read  this since I first heard about it. I am looking forward to it.

Behind Closed Doors

Another great book from Pragmatic Press… I am looking forward to it as well.
And the last one from the conference but not least:

JBoss at WorkScott & Tom, We don’t currently use JBoss where I am currently, but I promise to read it soon!
So, here are the other books on my plate right now:

Best of Ruby Quiz - (PDF)  it is helping me to become better at Ruby, man do I need help!

Rails Recipes -  (PDF, Beta Book) this book is proving invaluable.  It has all sorts of great tips and tricks in it.

Practices of an Agile Developer - I’ve already read this book, and blogged about it.  It was just released, so I am looking forward to seeing the final product, and reading it again… it is that good.

I am even thinking about revisiting my still-all-time-favorite: The Pragmatic Programmer.
Notice anything strange about this collection of books?  Thats right! I am single-handedly providing for Dave Thomas and Andy Hunt.  But you know what?  They have built the best development book publishing business. Period. And in just a few short years.  Some would even go so far as to say the best everything publishing business, period.  I think they deserve my money.  That does not make me a fanboy.

Books
General
Software Development

Comments (0)

Permalink

My Son, the 19 month old hacker

Yesterday I caught my son, Jack, hacking my computer. I had just turned off my laptop, closed the case and was getting something from the next room. This gave Jack ample time to scurry onto the couch, open my laptop and start looking intently at it. This is where I first noticed what he was doing.

“Meh, its turned off. He can’t hurt anything.”

“BEEP”.

“??? Um, meh. It’ll go through GRUB and land on the GDM login screen. He can’t hurt anything.” I move a little closer anyways…
“Jack what are you up to?”

The little guy had somehow gotten Root access to my Laptop!!! This is bad for two reasons:

1.) I have a security hole that I was not aware of, and
2.) I have a natural on my hands…

My wife actually snapped these pictures the day before yesterday.  Wonder what he did to my machine then?

General
Security

Comments (2)

Permalink