intel i7 3770K 3,5 ghz, 4 core, 8 threads
1.7.0_51-b13,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) (604)
█████████████████████████▌ Structs (*) (514)

Time of Full GC (ms)
███████████████████████████████ On heap (1551)
 Structs (3)


Iterate primitive Arrays

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

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


1st level member access

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

███████ on heap get(index).getIntVar() (145)
█████████████████████████████████████████▌ structs get(index).getIntVar() (837)
█████▌ structs pointer.getIntVar() (112)


3rd level embedded substructure access

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

██████ on heap version (621)
██████████████████▌ structs identical code to onheap (1861)
██████████ structs using pointers for iteration (1013)
██▌ structs using pointers for all accesses + inlined method (276)


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 (975)
███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ structs identical code (1237)
███████████████████████████████████████████████████████████████████████████████████████████████████████▌ structs using pointers (1039)
██████████████████████████████████████████████████████████████████▌ structs using direct pointer to embedded string (668)