Shawn Curry

+ Follow
since Dec 18, 2003
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shawn Curry

Guess I'm a johnny come lately to this discussion, but I have some interesting retorts to some of the performace topics that were discussed on this thread.
Basically, I have an XML parser I've been trying to squeeze a couple milliseconds out of; so I've rolled my own stack and hashmap data structures. Both grow by powers of 2.
The results I obtained were using a P4 @ 1.8GHz, J2SE 1.4.1, and J2EE 1.4.2.
As suggested by Josh Bloch here I built my testing framework to run n timed runs, and take an average of all the runs. Also, I'm running the JVM with the -Xnoclassgc option. Also, I wrote 2 init functions, one to build a sequential list, and one to build a random list.
  • Accessing with a single thread, the synchronized keyword did not affect my performace.
  • Sequentially numbered keys are faster in all cases.
  • HashMap suffers a penalty of approximately 5% on random lists.
  • Hashtable suffers nearly a 40% penatly.
  • HashMap is approximately 5% faster than Hashtable on random lists.
  • Hashtable is about 35% faster than HashMap on sequential lists.
  • In all cases MY implemention was faster

  • 32768 items, 30 runs, put(), remove():

    If anyone's still interested, I could post the testing framework.

    [ December 19, 2003: Message edited by: Shawn Curry ]
    17 years ago