Flip the coordinates
2006-10-31 Filed in: programming
As people occasionally re-discover, object-oriented data
structures are not always very efficient. A
recurring problem is how objects are usually
implemented by assuming that logical
relatedness must translate to physical
proximity.
How mis-guided.
In Fortran, collections of structs were often simulated by allocating arrays for each element, and indexing across multiple arrays to access struct fields. Somehow, we seem to have forgotten about the performance benefits that can give. I'll be even bolder and state that we're squandering huge amounts of performance by insisting on placing all fields of an object in adjacent memory slots.
Maybe one day others will see the light and figure out what Metakit and Vlerq are all about...
Update: See a related paper by Steve Johnson. Thx Andreas Kupries for the reference.
How mis-guided.
In Fortran, collections of structs were often simulated by allocating arrays for each element, and indexing across multiple arrays to access struct fields. Somehow, we seem to have forgotten about the performance benefits that can give. I'll be even bolder and state that we're squandering huge amounts of performance by insisting on placing all fields of an object in adjacent memory slots.
Maybe one day others will see the light and figure out what Metakit and Vlerq are all about...
Update: See a related paper by Steve Johnson. Thx Andreas Kupries for the reference.