SoCal: A Language for Memory-Layout Factorization of Recursive Datatypes

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Singhal, Vidush, Kainen, Mikah, Pelenitsyn, Artem, Borkowski, Michael H., Vollmer, Mike, Kulkarni, Milind
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910184947843072
author Singhal, Vidush
Kainen, Mikah
Pelenitsyn, Artem
Borkowski, Michael H.
Vollmer, Mike
Kulkarni, Milind
author_facet Singhal, Vidush
Kainen, Mikah
Pelenitsyn, Artem
Borkowski, Michael H.
Vollmer, Mike
Kulkarni, Milind
contents Array-of-structures (AoS) to structure-of-arrays (SoA) is a classic compiler transformation that improves memory locality and enables data-parallel execution. Existing AoS-to-SoA transformations primarily target regular, array-based programs in imperative languages like C and C++. In contrast, many applications manipulate tree-shaped data structures, for example, ASTs in compilers, DOM trees in browsers, and k-d trees in scientific workloads. Prior work improves the performance of functional programs operating on such data by serializing algebraic datatypes (ADTs) into contiguous memory buffers. However, these representations interleave fields within a single buffer, similar to AoS layouts. We introduce factored, multi-buffer layouts that store different ADT fields in separate buffers, enabling SoA-like layouts for serialized recursive data structures. We formalize this approach in SoCal, a language for generating factored ADT representations, and implement it in a compiler called Colobus. Colobus automatically transforms functional programs to operate over a serialized, factored layout of recursive ADTs. Our evaluation shows a 1.46x geometric mean speedup on a suite of tree-processing benchmarks.
format Preprint
id arxiv_https___arxiv_org_abs_2605_01140
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle SoCal: A Language for Memory-Layout Factorization of Recursive Datatypes
Singhal, Vidush
Kainen, Mikah
Pelenitsyn, Artem
Borkowski, Michael H.
Vollmer, Mike
Kulkarni, Milind
Programming Languages
Performance
D.3.4
Array-of-structures (AoS) to structure-of-arrays (SoA) is a classic compiler transformation that improves memory locality and enables data-parallel execution. Existing AoS-to-SoA transformations primarily target regular, array-based programs in imperative languages like C and C++. In contrast, many applications manipulate tree-shaped data structures, for example, ASTs in compilers, DOM trees in browsers, and k-d trees in scientific workloads. Prior work improves the performance of functional programs operating on such data by serializing algebraic datatypes (ADTs) into contiguous memory buffers. However, these representations interleave fields within a single buffer, similar to AoS layouts. We introduce factored, multi-buffer layouts that store different ADT fields in separate buffers, enabling SoA-like layouts for serialized recursive data structures. We formalize this approach in SoCal, a language for generating factored ADT representations, and implement it in a compiler called Colobus. Colobus automatically transforms functional programs to operate over a serialized, factored layout of recursive ADTs. Our evaluation shows a 1.46x geometric mean speedup on a suite of tree-processing benchmarks.
title SoCal: A Language for Memory-Layout Factorization of Recursive Datatypes
topic Programming Languages
Performance
D.3.4
url https://arxiv.org/abs/2605.01140