Javascript must be enabled to continue!
Compact Representations for Arrays in Lua
View through CrossRef
Several languages use a tagged representation for values, so that each value carries its own type during runtime. Lua, in particular, represents each value by a structure with two fields: A union for the values themselves and a byte with the tag. Despite its simplicity, this representation has a big drawback: Due to alignment restrictions, it typically wastes more than 40% of memory in padding. This waste is specially expensive for large arrays. In this work, we discuss alternative implementations for Lua arrays that eliminate this waste and evaluate them regarding performance, with a special focus on code overhead and memory locality. The presented data structures are quite generic, and can be used not only in the Lua interpreter, but in any program that needs arrays of tagged values.
Sociedade Brasileira de Computação
Title: Compact Representations for Arrays in Lua
Description:
Several languages use a tagged representation for values, so that each value carries its own type during runtime.
Lua, in particular, represents each value by a structure with two fields: A union for the values themselves and a byte with the tag.
Despite its simplicity, this representation has a big drawback: Due to alignment restrictions, it typically wastes more than 40% of memory in padding.
This waste is specially expensive for large arrays.
In this work, we discuss alternative implementations for Lua arrays that eliminate this waste and evaluate them regarding performance, with a special focus on code overhead and memory locality.
The presented data structures are quite generic, and can be used not only in the Lua interpreter, but in any program that needs arrays of tagged values.
Related Results
Assessment of the sustainability of the rice-maize cropping system in the Red River Delta of Vietnam and developing reduced tillage practices in rice-maize system in the area
Assessment of the sustainability of the rice-maize cropping system in the Red River Delta of Vietnam and developing reduced tillage practices in rice-maize system in the area
Rice and maize are global staple food and play an important role in world’s food security strategy. Vietnam is one of rice leading export countries but annually it has to import a ...
O Papel do Instagram na Decisão de Compras de Viagens de Lua de Mel: Um Estudo Sob a Perspectiva das Noivas.
O Papel do Instagram na Decisão de Compras de Viagens de Lua de Mel: Um Estudo Sob a Perspectiva das Noivas.
É cada vez mais perceptível, o poder de influência que as redes sociais têm sobre o comportamento do consumidor. Nesse sentido, este estudo buscou compreender como as postagens no ...
Meta-Representations as Representations of Processes
Meta-Representations as Representations of Processes
In this study, we explore how the notion of meta-representations in Higher-Order Theories (HOT) of consciousness can be implemented in computational models. HOT suggests that consc...
Assessing Array-Type Differences in Cochlear Implant Users Using the Panoramic ECAP Method
Assessing Array-Type Differences in Cochlear Implant Users Using the Panoramic ECAP Method
OBJECTIVES: Cochlear-implant companies manufacture devices with different electrode array types. Some arrays have a straight geometry designed for minimal neuronal trauma, while ot...
Self-Standing 3D Thin Film Cathodes for Micobatteries
Self-Standing 3D Thin Film Cathodes for Micobatteries
While the microelectronic industry is advancing at a rapid pace with smaller and smaller devices, the implementation of microelectro-mechanical systems (MEMS) on the market strongl...
Peculiarities of adaptive signal processing in circular antenna arrays
Peculiarities of adaptive signal processing in circular antenna arrays
Formulation of the problem. Today, antenna arrays are often used as directional antennas of different radio systems. The main advantages of the such antennas over the mechanically ...
The Entropy of Co-Compact Open Covers
The Entropy of Co-Compact Open Covers
Co-compact entropy is introduced as an invariant of topological conjugation for perfect mappings defined on any Hausdorff space (compactness and metrizability are not necessarily r...
Evaluation of Thermally Crosslinked Poly(Acrylic Acid-Co-Maleic Acid) (PAMA)/Poly(Vinyl Alcohol) (PVA) Microneedle Arrays
Evaluation of Thermally Crosslinked Poly(Acrylic Acid-Co-Maleic Acid) (PAMA)/Poly(Vinyl Alcohol) (PVA) Microneedle Arrays
This study aimed to evaluate the optimal conditions for crosslinked of PAMA/PVA microneedle (MN) arrays. Poly (acrylic acid-co-maleic acid) (PAMA)/poly (vinyl alcohol) (PVA) MN arr...

