SHAPES : Easy and high-level memory layouts
File(s)
Author(s)
Tasos, Alexandros
Type
Thesis
Abstract
CPU speeds have vastly exceeded those of RAM. As such, developers who aim to achieve high
performance on modern architectures will most likely need to consider how to use CPU caches
effectively, hence they will need to consider how to place data in memory so as to exploit spatial
locality and achieve high memory bandwidth.
Performing such manual memory optimisations usually sacrifices readability, maintainability,
memory safety, and object abstraction. This is further exacerbated in managed languages, such
as Java and C#, where the runtime abstracts away the memory from the developer and such
optimisations are, therefore, almost impossible.
To that extent, we present in this thesis a language extension called SHAPES . SHAPES aims
to offer developers more fine-grained control over the placement of data, without sacrificing
memory safety or object abstraction, hence retaining the expressiveness and familiarity of OOP.
SHAPES introduces the concepts of pools and layouts; programmers group related objects into
pools, and specify how objects are laid out in these pools. Classes and types are annotated
by pool parameters, which allow placement aspects to be changed orthogonally to how the
business logic operates on the objects in the pool. These design decisions disentangle business
logic and memory concerns.
We provide a formal model of SHAPES , present its type and memory safety model, and its
translation into a low-level language. We present our reasoning as to why we can expect
SHAPES to be compiled in an efficient manner in terms of the runtime representation of objects
and the access to their fields.
Moreover, we present SHAPES -z, an implementation of SHAPES as an embeddable language,
and shapeszc , the compiler for SHAPES -z. We provide our our design and implementation
considerations for SHAPES -z and shapeszc . Finally, we evaluate the performance of SHAPES
and SHAPES -z through case studies.
performance on modern architectures will most likely need to consider how to use CPU caches
effectively, hence they will need to consider how to place data in memory so as to exploit spatial
locality and achieve high memory bandwidth.
Performing such manual memory optimisations usually sacrifices readability, maintainability,
memory safety, and object abstraction. This is further exacerbated in managed languages, such
as Java and C#, where the runtime abstracts away the memory from the developer and such
optimisations are, therefore, almost impossible.
To that extent, we present in this thesis a language extension called SHAPES . SHAPES aims
to offer developers more fine-grained control over the placement of data, without sacrificing
memory safety or object abstraction, hence retaining the expressiveness and familiarity of OOP.
SHAPES introduces the concepts of pools and layouts; programmers group related objects into
pools, and specify how objects are laid out in these pools. Classes and types are annotated
by pool parameters, which allow placement aspects to be changed orthogonally to how the
business logic operates on the objects in the pool. These design decisions disentangle business
logic and memory concerns.
We provide a formal model of SHAPES , present its type and memory safety model, and its
translation into a low-level language. We present our reasoning as to why we can expect
SHAPES to be compiled in an efficient manner in terms of the runtime representation of objects
and the access to their fields.
Moreover, we present SHAPES -z, an implementation of SHAPES as an embeddable language,
and shapeszc , the compiler for SHAPES -z. We provide our our design and implementation
considerations for SHAPES -z and shapeszc . Finally, we evaluate the performance of SHAPES
and SHAPES -z through case studies.
Version
Open Access
Date Issued
2022-10
Date Awarded
2023-03
Copyright Statement
Creative Commons Attribution NonCommercial Licence
License URL
Advisor
Drossopoulou, Sophia
Eisenbach, Susan
Sponsor
Engineering and Physical Sciences Research Council (EPSRC)
Grant Number
EP/L016796/1
Publisher Department
Computing
Publisher Institution
Imperial College London
Qualification Level
Doctoral
Qualification Name
Doctor of Philosophy (PhD)
