SUMMARYTwo-dimensional arrays are generally arranged in memory in row-major order or column-major order. Traversing a row-major array in column-major order, or vice versa, leads to poor spatial locality. With large arrays the performance loss can be a factor of 10 or more. This paper explores the Morton storage layout, which has substantial spatial locality whether traversed in row-major or column-major order. Using a small suite of dense kernels working on two-dimensional arrays, we have carried out an extensive study of the impact of poor array layout and of whether Morton layout can offer an attractive compromise. We show that Morton layout can lead to better performance than the worse of the two canonical layouts; however, the performance of Morton layout compared to the better choice of canonical layout is often disappointing. We further study one simple improvement of the basic Morton scheme: we show that choosing the correct alignment for the base address of an array in Morton layout can sometimes significantly improve the competitiveness of this layout.
DeepWeaver-1 is a tool supporting cross-cutting program analysis and transformation components, called "weaves". Like an aspect, a DeepWeaver weave consists of a query part, and a part which may modify code. DeepWeaver's query language is based on Prolog, and provides access to data-flow and control-flow reachability analyses. DeepWeaver provides a declarative way to access the internal structure of methods, and supports cross-cutting weaves which operate on code blocks from different parts of the codebase simultaneously. Deep-Weaver operates at the level of bytecode, but offers predicates to extract structured control flow constructs. This paper motivates the design, and demonstrates some of its power, using a sequence of examples including performance profiling and domain-specific performance optimisations for database access and remote method invocation. Introduction. Aspect-oriented programming tools, such as AspectJ [12], can be used to implement performance optimizations. However, tools like AspectJ are too weak, both to perform interesting optimizing transformations, and to capture the conditions for their validity. Similar problems arise when using AspectJ for static program analysis, e.g. to check usage rules for library code, or to detect software defects. For many, this is a consequence of deliberate simplicity in the aspect language design. This paper presents a prototype system which is powerful enough to express complex analyses (and transformations)-yet, like an aspect weaver, retains a declarative style by which some simplicity can be retained. The tool is motivated and illustrated using a series of examples, including intramethod performance profiling, and domain-specific optimizations for database access and remote method invocation. Example. We begin with a very simple motivating example, a domain-specific performance optimisation for Java code that uses the JDBC (Java Database Connectivity) library. Consider this Java fragment: ResultSet staff = statement.executeQuery("SELECT * FROM employees"); ResultSet clients = statement.executeQuery("SELECT * FROM customers"); ... complex and messy code that uses clients but not staff ...
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.