Groups | Search | Server Info | Keyboard shortcuts | Login | Register
Groups > comp.lang.java.programmer > #5824
| From | lbrt chx _ gemale kom |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | baseline performance test using java ... |
| Organization | Acecape, Inc. |
| Organization | Newshosting.com - Highest quality at a great price! www.newshosting.com |
| Message-ID | <1309646728.550644@nntp.aceinnovative.com> (permalink) |
| Date | 2011-07-02 22:45 +0000 |
~ 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 ~ It does not make any sense to say some code runs "fast" when you do not specify "fast" in relation to what. In fact good software developers treat themselves with crappy/poor boxes ;-) ~ Unless the algo deals with no logic (say, just raw I/O (which is what OSs should do anyway)) there is going to always be an actual delay due to the logical stack of your algorithm/code on top, so the delay should be given as a percentage relative to the underlying performance ~ This is approximately what I have in mind; you would run your code like: ~ http://download.oracle.com/javase/1.5.0/docs/tooldocs/solaris/java.html ~ java -version > version.txt java -verbose:class -XX:+PrintGCTimeStamps -XX:+PrintGCDetails code class.txt 2>&1 java -verbose:jni -XX:+PrintGCTimeStamps -XX:+PrintGCDetails code jni.txt 2>&1 java -verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails code gc.txt 2>&1 ~ from where you could know "where the rubber meets the road" and then, say; if you notice in class.txt and jni.txt lines like: ~ [Loaded java.io.FileOutputStream from /media/sda1/inst/sw/jdk/jdk1.7.0/jre/lib/rt.jar] ~ [Dynamic-linking native method java.io.FileOutputStream.writeBytes ... JNI] ~ and FileOutputStream.writeBytes tax your code, then some test units could be automatically produced in order to just go FileOutputStream.writeBytes (without logic of your code) and even different forms of writeBytes out of the java API could be tried (nio ...) and those file system areas a user has access to. ~ This is more testing/profiling methodology than strictly Java related so the java results could be used for some other code as well ~ Anything like this out there you could use? ~ lbrtchx
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar
baseline performance test using java ... lbrt chx _ gemale kom - 2011-07-02 22:45 +0000 Re: baseline performance test using java ... markspace <-@.> - 2011-07-02 16:00 -0700 Re: baseline performance test using java ... Patricia Shanahan <pats@acm.org> - 2011-07-02 16:50 -0700
csiph-web