Abstract
Swizzling refers to the translation of object references from an external, persistent format to an internal,
transient format used during application execution. Eager swizzling schemes translate all the references
contained by objects as they are made resident. Lazy swizzling schemes defer translation of references until
they are loaded from their container. Eager swizzling has the advantage of presenting a uniformly swizzled
representation of references to the execution engine, at the cost of up-front translation of references that may
never be used. Lazy swizzling avoids this cost, but requires a run-time check that called a swizzle barrier to
detect and convert unswizzled references as they are accessed. Lazy swizzling is most often used in situations
where accesses are likely to be sparse and the up-front cost of eager swizzling is prohibitive. For example,
large containers, such as arrays, may contain many thousands of references, only a fraction of which are ever
actually accessed, let alone used to access their target. Thus, lazy swizzling of arrays makes sense even while
other types of objects are eagerly swizzled, in which case every array access must be protected by a swizzle
barrier. Many, if not most, of these barriers will occur in the bodies of loops that iterate through the elements
of arrays. Here, we describe how to hoist loop-nested swizzle barriers into one inclusive barrier operation
that can be performed outside the loop, and which swizzles the subset of array elements accessed in the loop
body. Our approach to array swizzle barrier optimization is based on loop induction variable analysis. We
have implemented this approach for the PJama prototype of orthogonal persistence for Java. In experiments
with several benchmark applications our optimizations reduce the number of swizzle barriers executed by an
average of 66%.
transient format used during application execution. Eager swizzling schemes translate all the references
contained by objects as they are made resident. Lazy swizzling schemes defer translation of references until
they are loaded from their container. Eager swizzling has the advantage of presenting a uniformly swizzled
representation of references to the execution engine, at the cost of up-front translation of references that may
never be used. Lazy swizzling avoids this cost, but requires a run-time check that called a swizzle barrier to
detect and convert unswizzled references as they are accessed. Lazy swizzling is most often used in situations
where accesses are likely to be sparse and the up-front cost of eager swizzling is prohibitive. For example,
large containers, such as arrays, may contain many thousands of references, only a fraction of which are ever
actually accessed, let alone used to access their target. Thus, lazy swizzling of arrays makes sense even while
other types of objects are eagerly swizzled, in which case every array access must be protected by a swizzle
barrier. Many, if not most, of these barriers will occur in the bodies of loops that iterate through the elements
of arrays. Here, we describe how to hoist loop-nested swizzle barriers into one inclusive barrier operation
that can be performed outside the loop, and which swizzles the subset of array elements accessed in the loop
body. Our approach to array swizzle barrier optimization is based on loop induction variable analysis. We
have implemented this approach for the PJama prototype of orthogonal persistence for Java. In experiments
with several benchmark applications our optimizations reduce the number of swizzle barriers executed by an
average of 66%.
Original language | English |
---|---|
Title of host publication | Advances in Persistent Object Systems |
Subtitle of host publication | POS-8 and PJAVA-3 |
Editors | Ron Morrison, Mick Jordan, Malcolm Atkinson |
Publisher | Morgan Kauffman Publishers |
Pages | 268-278 |
ISBN (Print) | 1-55860-585-1 |
Publication status | Published - 1998 |
Externally published | Yes |