Java Performance Services
Training, Seminars, Benchmarking, Tuning

Java Performance Tuning Course


Chania Crete, May 17-20, 2010


Sun Extreme Learning EXL-2025

Houston, December 1-4,2009
New York, December 8-11, 2009
Washington DC, January 5-8, 2010



San Francisco, January 11-14

Anti-if

I have joined Anti-IF Campaign

Calendar

««Nov 2009»»
SMTWTFS
1234
5
67
891011121314
15161718192021
22232425262728
2930

Performance Anti-Patterns

My Top Tags

                                       

Mailing List

My RSS Feeds








lack of requirements responsible for pre-mature optimizations

posted Friday, 15 June 2007

Yesterday I presented my 1 day performance tuning seminar to a group in the Netherlands. They were an every engaging group and they sparked some very interesting discussions. One was regarding the old adage of pre-mature optimizations. The mantra is; make it work then make it fast. Though I do think that you do have to consider performance up front, it is advice that can't be ignored. I can cite numerous cases where people were trying to get code to run very fast before they actually had it functional. However I can also say that in just about every one of these cases the developer was lacking in requirements that would have helped him decide wether or not the optimization was premature or necessary.

For example, bubble sort is O(N^2) where as quicksort is O(nlogn). So obviously quicksort is much faster right? Well it depends, if you've got a small number of things doing a bubble sort will be quicker. The question is; do you have enough information in the form of requirements to know if the simple bubble sort is good enough for you're going to need to resort to the more complex quicksort. If you do have enough information then maybe coding up the quicksort isn't a premature optimization. If you don't have enough information then I'd have to say that it is. In either case it behooves you to isolate the sorting away from the rest of the application so that when you finally do get real requirements you can make it fast, if it isn't already fast enough.

tags:        




1. William Louth left...
Monday, 18 June 2007 8:10 pm :: http://blog.jinspired.com

It would be nice if the context behind the phrase "pre-mature optimizations is the root of evil" was cearly explained. Knowing the requirements is certainly important but this is only one part of the many activities that should be performed when applying software performance engineering (SPE) whether it is formal or not. In my experience effort is wasted (the evil) in any engineering activity when an engineers fails to derive a working model of the problem (situation).

I still cannot understand why SPE is not advocated more than it is. I can understand vendors (excluding myself) focusing on tools rather than process and models. But without a valid and verified performance model (and not just some tips or code snippets or adhoc tools) IT management staff will always expend more effort than is required in troubleshooting possible performance problems.

Recommended Link: http://www.perfeng.com

regards,

William