mulander / evolutionchamber

Automatically exported from code.google.com/p/evolutionchamber
0 stars 0 forks source link

Move from MultiValueMap to HashMap with ArrayLists #159

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Two main things I played with here are adding an ordering to the ArrayList to 
again remove an iterator and to cache the Integer Classes since the HashTables 
all requires classes instead of primitive types (as well as keep a counter for 
the number of actions beyond the last called time in get()).

I saw a 5% - 7% speed increase without waypoints and no speed changes with 
waypoints.

Original issue reported on code.google.com by nafets...@gmail.com on 24 Nov 2010 at 9:16

Attachments:

GoogleCodeExporter commented 8 years ago
I applied your patch and observed a 15% improvement for just the final tab in 
use.
Thanks! :)

Fixed in r135

Original comment by netpr...@gmail.com on 24 Nov 2010 at 9:34

GoogleCodeExporter commented 8 years ago

Original comment by netpr...@gmail.com on 24 Nov 2010 at 9:35

GoogleCodeExporter commented 8 years ago
I did some speed tests to look at how much this patch improved performance.  
Using the two different kinds of tests that netprobe used in  issue 158  (one 
with and one without waypoints), I calculated the average games played per 
second with two different versions of the application (before and after the 
patch).  The two tests are described below.

Before running each test, I deleted the "etc" directory and restarted Evolution 
Chamber to avoid caching or memory issues that might effect performance.  Each 
test used 1 processor and ran for 20 seconds.  The average games played per 
second was calculated using code that I added to the application.  I didn't 
check the resulting build order for accuracy...I only focused on the speed.

Test 1:
Final: 7 Mutas, +1 Flyer Attack

Test 2:
WP0: 6 Zerglings
WP1: 6 Roaches
WP2: 2 Hydralisks
WP3: 3 Overseers
Final: 7 Mutalisks, +1 Flyer Attack

==========

Before patch (r133):
Test 1: 1759.2064123080545
Test 2: 2034.8954968418927

After patch:
Test 1: 1842.6190931295293 (~5% increase)
Test 2: 2184.36567092616 (~7% increase)

Original comment by mike.angstadt on 29 Nov 2010 at 11:23

GoogleCodeExporter commented 8 years ago
nafets.st, check out my line-by-line comments here:

http://code.google.com/p/evolutionchamber/source/detail?r=135

Original comment by mike.angstadt on 29 Nov 2010 at 11:47