intel i7 3770K 3,5 ghz, 4 core, 8 threads
1.7.0_40-ea-b35,Java HotSpot(TM) 64-Bit Server VM,Windows 8

Instantiation Time (CMS Collector)

Duration to allocate and initialize an array[500000] of complex Objects (TestInstrument containing a list of embedded TestInstrumentLeg Objects).
Note: Instantiation time differs depending on GC-Algorithm, difference in Full GC stays across DefaultGC, CMS and G1. G1 and Default GC are significantly faster in on-heap allocation.

time(ms) smaller is better
██████████████████████████▌ On Heap (excl. GC cost) (539)
██████████████████████████████▌ Structs (*) (612)

Time of Full GC (ms)
██████████████████████▌ On heap (1126)
 Structs (1)


Iterate primitive Arrays

benchmark performance of calculating the sum of all elements of an embedded int array.

██████▌ on heap (65)
██████████▌ structs identical code (109)
██████▌ structs using pointers instead of get(index) (67)


1st level member access

iterate structure array and access an integer member variable of each.

████▌ on heap get(index).getIntVar() (98)
█████████████████████████████████████▌ structs get(index).getIntVar() (754)
█████ structs pointer.getIntVar() (108)


3rd level embedded substructure access

iterate structure array, access each element of an embedded substructure's int array.

████▌ on heap version (484)
██████████████ structs identical code to onheap (1418)
████████▌ structs using pointers for iteration (858)
██ structs using pointers for all accesses + inlined method (248)


Linear search for first instrument in array with name.equals(given string)

iterate structure array, access a string enbedded in each element and compare it.

█████ on heap (54)
██████████████████ structs identical code (183)
██████████████ structs using pointers (144)
█▌ structs using direct pointer to embedded string (19)