Table of Contents
Fetching ...

Adjusted Objects: An Efficient and Principled Approach to Scalable Programming (Extended Version)

Boubacar Kane, Pierre Sutra

TL;DR

This work tackles the challenge of scaling parallel programs that rely on strongly-consistent shared objects. It introduces adjusted objects, objects tailored to a specific usage by narrowing interfaces and access permissions, and formalizes their scalability via the indistinguishability graph. The DEGO library provides drop-in adjusted objects for Java, implemented with segmentation and fine-grained memory models, delivering up to two orders of magnitude speedups in micro-benchmarks and up to 1.7x in a Retwis-like social-network benchmark. The approach is supported by analyses of object usage in real projects and a thorough evaluation showing reduced contention and improved cache behavior, offering a practical path to more scalable parallel software.

Abstract

Parallel programs require software support to coordinate access to shared data. For this purpose, modern programming languages provide strongly-consistent shared objects. To account for their many usages, these objects offer a large API. However, in practice, each program calls only a tiny fraction of the interface. Leveraging such an observation, we propose to tailor a shared object for a specific usage. We call this principle adjusted objects. Adjusted objects already exist in the wild. This paper provides their first systematic study. We explain how everyday programmers already adjust common shared objects (such as queues, maps, and counters) for better performance. We present the formal foundations of adjusted objects using a new tool to characterize scalability, the indistinguishability graph. Leveraging this study, we introduce a library named DEGO to inject adjusted objects in a Java program. In micro-benchmarks, objects from the DEGO library improve the performance of standard JDK shared objects by up to two orders of magnitude. We also evaluate DEGO with a Retwis-like benchmark modeled after a social network application. On a modern server-class machine, DEGO boosts by up to 1.7x the performance of the benchmark.

Adjusted Objects: An Efficient and Principled Approach to Scalable Programming (Extended Version)

TL;DR

This work tackles the challenge of scaling parallel programs that rely on strongly-consistent shared objects. It introduces adjusted objects, objects tailored to a specific usage by narrowing interfaces and access permissions, and formalizes their scalability via the indistinguishability graph. The DEGO library provides drop-in adjusted objects for Java, implemented with segmentation and fine-grained memory models, delivering up to two orders of magnitude speedups in micro-benchmarks and up to 1.7x in a Retwis-like social-network benchmark. The approach is supported by analyses of object usage in real projects and a thorough evaluation showing reduced contention and improved cache behavior, offering a practical path to more scalable parallel software.

Abstract

Parallel programs require software support to coordinate access to shared data. For this purpose, modern programming languages provide strongly-consistent shared objects. To account for their many usages, these objects offer a large API. However, in practice, each program calls only a tiny fraction of the interface. Leveraging such an observation, we propose to tailor a shared object for a specific usage. We call this principle adjusted objects. Adjusted objects already exist in the wild. This paper provides their first systematic study. We explain how everyday programmers already adjust common shared objects (such as queues, maps, and counters) for better performance. We present the formal foundations of adjusted objects using a new tool to characterize scalability, the indistinguishability graph. Leveraging this study, we introduce a library named DEGO to inject adjusted objects in a Java program. In micro-benchmarks, objects from the DEGO library improve the performance of standard JDK shared objects by up to two orders of magnitude. We also evaluate DEGO with a Retwis-like benchmark modeled after a social network application. On a modern server-class machine, DEGO boosts by up to 1.7x the performance of the benchmark.
Paper Structure (57 sections, 17 theorems, 1 equation, 11 figures, 2 tables)

This paper contains 57 sections, 17 theorems, 1 equation, 11 figures, 2 tables.

Key Result

Theorem 1

Consider a readable data type $T$. Then, $\mathit{CN}\xspace(T) = \max ~\{ k : \exists l \geq 2 \ldotp\xspace T \in \mathcal{D}(k,l)\xspace \} \cup \{ 1 \}$

Figures (11)

  • Figure 1: Usage of $\text{AtomicLong}$ across different open-source Java projects: (left) lists the methods that are called. (right) indicates if the returned value of a method is used (+), or not ($\times$) in Apache Cassandra.
  • Figure 2: From left to right, the indistinguishability graph $\mathcal{G}\xspace(\{{\color{Blue}{\mathsf{a}}}\xspace,{\color{Crimson}{\mathsf{b}}}\xspace,{\color{DarkGreen}{\mathsf{c}}}\xspace\})$ for a reference (${\color{Blue}{\mathsf{a}}}\xspace=\mathit{set}\xspace(1)$, ${\color{Crimson}{\mathsf{b}}}\xspace=\mathit{set}\xspace(2)$, ${\color{DarkGreen}{\mathsf{c}}}\xspace=\mathit{get}\xspace()$), a set (${\color{Blue}{\mathsf{a}}}\xspace=\mathit{add}\xspace(1)$, ${\color{Crimson}{\mathsf{b}}}\xspace=\mathit{add}\xspace(1)$, ${\color{DarkGreen}{\mathsf{c}}}\xspace=\mathit{contains}\xspace(1)$), and a counter (${\color{Blue}{\mathsf{a}}}\xspace=\mathit{inc}\xspace(1)$, ${\color{Crimson}{\mathsf{b}}}\xspace=\mathit{inc}\xspace(3)$, ${\color{DarkGreen}{\mathsf{c}}}\xspace=\mathit{inc}\xspace(5)$).
  • Figure 3: We combine subtyping ($\xrightarrow{\text{p}}$, $\xrightarrow{\text{r}}$) and restrictions of access ($\xrightarrow{\text{d}}$, $\xrightarrow{\text{c}}$, $\xrightarrow{\text{m}}$) to adjust an object.
  • Figure 4: Number of declarations of shared objects in the ASF projects: (top) on average over time, and (bot) in the 20 most modified files for the latest version of each project.
  • Figure 5: Most used methods in the ASF projects.
  • ...and 6 more figures

Theorems & Definitions (18)

  • Theorem 1
  • Proposition 1
  • Proposition 2
  • Proposition 3
  • Proposition 4
  • Definition 1
  • Proposition 5
  • Proposition 6
  • Theorem 1
  • Corollary 1
  • ...and 8 more