https://doi.org/10.1051/epjconf/202125103002
AwkwardForth: accelerating Uproot with an internal DSL
1 Princeton University, Princeton, New Jersey, United States.
2 Institute of Engineering and Management, Kolkata, West Bengal, India
* e-mail: pivarski@princeton.edu
** e-mail: ianna.osborne@cern.ch
*** e-mail: reikdas@gmail.com
**** e-mail: david.lange@cern.ch
† e-mail: peter.elmer@cern.ch
Published online: 23 August 2021
File formats for generic data structures, such as ROOT, Avro, and Parquet, pose a problem for deserialization: it must be fast, but its code depends on the type of the data structure, not known at compile-time. Just-in-time compilation can satisfy both constraints, but we propose a more portable solution: specialized virtual machines. AwkwardForth is a Forth-driven virtual machine for deserializing data into Awkward Arrays. As a language, it is not intended for humans to write, but it loosens the coupling between Uproot and Awkward Array. AwkwardForth programs for deserializing record-oriented formats (ROOT and Avro) are about as fast as C++ ROOT and 10–80× faster than fastavro. Columnar formats (simple TTrees, RNTuple, and Parquet) only require specialization to interpret metadata and are therefore faster with precompiled code.
© The Authors, published by EDP Sciences, 2021
This is an Open Access article distributed under the terms of the Creative Commons Attribution License 4.0, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.