Kirk Pepperdine

Author
+ Follow
since Jan 17, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kirk Pepperdine

Originally posted by James Carman:
Oh, that's O(m + n) where m = len(string) and n = len(invalidString)



which is O(n)
16 years ago
I'm trying to devise a way to support the deployment of an application that has been written by several teams. Each of the teams has developed a portion of the appliction that will contain web and ejb components. One team has provided some technical services that are being used by the others. What I'm trying to do is pre-deploy the technical services so that the other teams don't have to. What I'm finding is that the other teams are not able to deploy into this environment because... the units of deployment (war or jar) get loaded into totally seperate class loaders. So, I've been looking to see if I can specify that the technical services be in a parent classloader (not the system classloader).

If anyone has any advice on how to support a complex development environment, I'd be sure happy to listen to it.

TIA,
Kirk
17 years ago
Humm, the problem here is that the benchmark doesn't consider the effects of GC, OSR and a number of other issues (running MBM in main). Try running the benchmark several times and then calculate the variance. If it's quite aways from being a non-zero value(which is will be), then something is interfering with the test. In other words, I see no reason for my being able to trust your results. In fact, I see every reason to doubt them.
But, it's easy to be critical and not offer any solutions so, instead of looking mean, I'd like to appear to be helpful.
First, the interface issue is quite valid so the tests results cannot be extrapolated to other collections. Here are some tips for doing the MBM
1) put the test into it's own (non-static) method.
2) call that method at least once to pre-heat the jit'ed method cache.
3) call System.gc() and then Thread.sleep(500 or 1000ms) to let the system settledown before taking the measurement.
4) call the test a number of times.. use statistics (standard deviation, max, min, median) to tell you when you have a good run. Remember, you are looking for as close to a non-zero variance in the results as is useful.
5) run the test with the -verbose:gc flag... this will tell you if you've eliminated GC as a source of noise. If not consider techniques to eliminate object creation/gc from the test. These include precreating and holding onto objects in an array. The array can be released outside of the timed loop. One can also -Xms and -Xmx to increase the size of heap. Make a call to system.gc between tests. don't forget to sleep to allow the system to settledown after calling for a GC. Do no use test results with the -verbose:gc flag set as these number will be effected by the flag
6) do the test for iterators
7) repeat the test for enumerations.
8) report average, sample size, and variance (max, min and median would also be nice).
HTH,
Kirk
17 years ago
"This preoccupation with overhead is a widespread evil that can lead to nothing but trouble. Having some idea about which operations are expensive and which are cheap is great"
Humm, you seem to have contridicted yourself in a meaningful way
17 years ago
HP has two tools that rock, HP JMeter and HP JTune and they are free.
17 years ago

Originally posted by Jim Yingst:
[QB]Are you always looking up a specific state, gender, and age? I might define a class combining state + gender into a single key (with equals() and hashCode() methods.
One thing that you maybe able to do is design a collection class that contains mulitple indexing schemes. In this case since you are looking for a range, I might suggest that you use a N-M tree for one of the indexes. Use that structure for age.
HTH

17 years ago

Originally posted by Eugene Kononov:
Hah, you too! People sometimes look at me strangely when I put repeated GC's in front of a measurement like this, but the fact is that I really have observed different results depending on whether I GC 1, 2, or even 3 times. Never obeserved any difference past 3, so far, but it wouldn't surprise me.
I've seen GC kicking in as much as 5 times before it reclaimed everything. Generational garbage collectors became too smart.
This full GC may take 3 to 5 seconds or even longer.


I always add a sleep after the GC. As you said, a full GC may take quite some time to complete and you do want GC to be completed before taking any timings. In some most cases, I've found this to be very effective, more effective than calling gc multiple times.
18 years ago
Just thought I'd harass you guys over for a change
In my typical setup, my source directories are scattered about. This allows me to break up a project source by categories of layers and components.
The last time that I downloaded eclipse to check it out. I quickly abandoned the tool because I could not get it to adapt to my pre-existing appliction. It wanted me to abandon my way of working. So I abandoned Eclipse instead.
Has this changes, does eclipse now support mutiple source paths with may or may not lie with-in the current root project?
After being a consultant that used what ever tools the client provided me with, I'd have to say that I've run th gammit of IDE's. IntelliJ was the first IDE out of the bunch that I used that I felt worked with me. The features that we added in 3.0 allowed me to integrate IntelliJ with my own customized scripting language. Tool integration is very easy. The IDE works with me, not against me in that it helps to avoid mistakes as well as being extremely configurable. As was mentioned, templating is a great feature.
I like the IDE so much, I forked over my own cash to get a license and now use it unless the client insists that I use theirs.
Having said this, a development environment is one where personal choice does play a big role. In my case, I found that IntelliJ was a good fit. You may not so, I'd suggest that get an evaluation license and try before you buy.
I have run several MBM's for each of the five tips and have so far, not been able to find then to hold. I had a small interaction with the authors of the paper but, it did not lead to any satisfactory explination as to why I was unable to reproduce the results.
I believe that our bartender got it right and that, the byte code tells all!
18 years ago
Zen and the Art of Performance Tuning..
Every water tower can be filled one spoonfull at a time.
18 years ago

Originally posted by robin harris:
[QB]I am evaluating code that has some very high complexity (McCabe Cyclomatic) and are difficult to test and certify. There are a large number of embedded logic paths (if, else), while and other iterative logic.
I'd be warry about picking this code apart if the corrisponding fan out and Demeter metrics are also out of range. IME, these three numbers often (but not always) travel together as they are an indication of the authors understanding of good OO prinicpals.

18 years ago
Wow, I won, I won
18 years ago
Well all,
It's been a blast but now for us in Europe, it's past time to sign-off and find a pub. Thanks for all the great questions. I hope that I didn't steer anyone too far of course.
I will (of course) be trolling this list and of course, you can email be directly at
kirk@javaperformancetuning.com
Thanks for your patronage.
18 years ago