Algorithm Engineering
Zugangsaufgabe 1
Stefan von der Krone
11M-IM
Max-Fill-Test
Random _rand = new Random();List<Long> _list = new ArrayList<Long>();// = new LinkedList<Long>();int _numSuccessfullFills = 0;int _numFills = Integer.MAX_VALUE;...while (_numSuccessfullFills < _numFills) { try { _list.add(_rand.nextLong()); _numSuccessfullFills++; } catch (OutOfMemoryError e) { System.out.print("test ended with " +
Integer.toString(_numSuccessfullFills) +
" successfull fills!"); break; } }
MAX-Fill-test
Test-Umgebung:
- Java-Version: 1.7.0_15
- Java-VM-Optionen:
- -Xms2g (initial heap size: 2GB)
- -Xmx4g (max heap size: 4GB)
- OS: Mac OS X 10.9
- Maschine: MacBook (Mid 2012)
- 2,9 GHz Intel Core i7, DualCore, HT
- 16 GB 1600MHz DDR3
Max-Fill-Test
- ArrayList<Long>: 146.693.833 Elemente
- LinkedList<Long>: 86.488.996 Elemente
Add-N-Test
int _numFills = #N#; N =
15.000.000
10.000.000
7.500.000
5.000.000
2.500.000
1.000.000
Add-N-Test
ArrayList<Long>
N Durchschnitt Standardabweichung Maximum Minimum15.000.000 1155,05 ms 121,79 ms 1474 ms 1061 ms10.000.000 308,25 ms 38,63 ms 467 ms 283 ms7.500.000 225,20 ms 28,97 ms 345 ms 209 ms5.000.000 151,45 ms 26,61 ms 265 ms 141 ms2.500.000 76,35 ms 13,50 ms 123 ms 69 ms1.000.000 31,60 ms 8,15 ms 58 ms 27 ms
Add-N-Test
LinkedList<Long>
N Durchschnitt Standardabweichung Maximum Minimum15.000.000 1740,40 ms 136,31 ms 2241 ms 1593 ms10.000.000 329,50 ms 75,10 ms 648 ms 293 ms7.500.000 249,05 ms 34,37 ms 385 ms 222 ms5.000.000 159,10 ms 26,01 ms 261 ms 145 ms2.500.000 81,55 ms 18,90 ms 160 ms 72 ms1.000.000 33,70 ms 8,68 ms 65 ms 29 ms
List-iterator-test
int _numFills = #N#; N =
30.000.000
25.000.000
22.500.000
20.000.000
17.500.000
15.000.000
List-Iterator-Test
int _numFills; int _middleIndex;..._numFills = #N#; _middleIndex = _numFills >> 1;...long i = 0; while (i < _numFills) { try { _list.add( i ); } catch (OutOfMemoryError e) { e.printStackTrace(); break; } i++; }
List-Iterator-Test
ArrayList<Long>
N Durchschnitt Standardabweichung Maximum Minimum30.000.000 26.03 ms 4,78 ms 42 ms 23 ms25.000.000 21,30 ms 2,76 ms 32 ms 19 ms22.500.000 19,65 ms 3,26 ms 31 ms 17 ms20.000.000 17,05 ms 3,01 ms 29 ms 15 ms17.500.000 16,80 ms 4,61 ms 31 ms 13 ms15.000.000 12,90 ms 3,28 ms 27 ms 11 ms
List-Iterator-Test
LinkedList<Long>
N Durchschnitt Standardabweichung Maximum Minimum30.000.000 111,10 ms 19,82 ms 180 ms 95 ms25.000.000 91,80 ms 12,40 ms 119 ms 79 ms22.500.000 80,10 ms 7,93 ms 104 ms 71 ms20.000.000 67,20 ms 6,19 ms 83 ms 63 ms17.500.000 58,35 ms 5,68 ms 81 ms 55 ms15.000.000 50,35 ms 3,71 ms 62 ms 47 ms
Test-Szenario #1
Remove-First
int i = 0;
int l = _list.size();
while ( i < l ) {
_list.remove( 0 );
i++;
}Test-Szenario #1
Remove-First
- ArrayList
- n = 100.000
- 756.6ms
- LinkedList
- n = 10.000.000
- 54.95ms
TEST-Szenario #2
Remove-Last
int i = 0;
int l = _list.size();
while ( i < l ) {
_list.remove( _list.size() - 1 );
i++;
}
Test-Szenario #2
Remove-Last
- ArrayList
- n = 10.000.000
- 14.05ms
- LinkedList
- n = 10.000.000
- 56.35ms
Zugangsaufgabe 1
By Stefan Von Der Krone
Zugangsaufgabe 1
- 428



