## Swizzle barrier optimizations for orthogonal persistence in Java

#### 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 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%.

@inproceedings{Brahnmath+1998PJW,
author = {Brahnmath, Kumar and Nystrom, Nathaniel and Hosking, Antony and Cutts, Quintin},
title = {Swizzle barrier optimizations for orthogonal persistence in
{J}ava},
booktitle = {International Workshop on Persistence and Java},
series = {PJW},
year = {1998},
editor = {Morrison, Ron and Jordan, Mick and Atkinson, Malcolm},
pages = {268--278},
month = {August},