Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!news.glorb.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 02 Jul 2011 18:50:09 -0500 Date: Sat, 02 Jul 2011 16:50:16 -0700 From: Patricia Shanahan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: baseline performance test using java ... References: <1309646728.550644@nntp.aceinnovative.com> In-Reply-To: <1309646728.550644@nntp.aceinnovative.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Lines: 35 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 70.230.196.78 X-Trace: sv3-7bSmzjY5DsmrA5JpeIQb5wbcg/t6vPBLTLXlwGXtRF2icCP1RZ6XTlStbMqh7Pw5Rp/u+IWkTx9xS6K!HPSSGKUU225cLMeT98A+JjGrt4j5gwFOH9rIApIJQyAlACiytJOaQdZN7NQVFm5sIkzOmRyyxyUh!sl4GgYKCcZ5v30wVMD3ZLdqInTIWlRESQ5T71FuRUehieg== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2762 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5826 On 7/2/2011 3:45 PM, lbrt chx _ gemale kom wrote: > > I have searched to no avail for some kind of hardware baseline > performance test for a piece of code. > > Notice that I don't mean to "profile" code, with "baseline" I mean > that the actual performance of an algorithm should me gauged against > its underlying hardware and OS, like its I/O subsystem (RAM (types, > speed, amount), file access, ...) > > We have all learned we should avoid String(s) and use StringBuffer(s) > or better yet StringBuilder(s) but there is definitely more to > performance testing/gains Personally, I have not learned to avoid Strings. I use them where appropriate, for example when I have an immutable string. I use StringBuilder when I need to build a string through many steps. In general, benchmarking, like any experiment, only makes sense if you have some questions you want answered, and the measurements will answer those questions. I'm not at all clear what your questions are. "Performance of an algorithm" is a non-trivial concept. The most algorithm-specific measure of performance is computational complexity, but that is a matter of analysis, not measurement. Of course, one often needs to know how fast an algorithm will run for a specific problem size on a specific system. In that case, measurement is definitely the way to go. With modern computers, any sort of isolated measurement can be misleading. There is so much caching and prediction that code can behave very differently in different contexts. Patricia