Merge pull request #78257 from Calinou/doc-packed-arrays-vs-typed-arrays

Document the upsides and downsides of packed arrays versus typed arrays
This commit is contained in:
Rémi Verschelde
2024-04-08 11:17:31 +02:00
7 changed files with 7 additions and 0 deletions

View File

@@ -6,6 +6,7 @@
<description>
An array specifically designed to hold 64-bit floating-point values (double). Packs data tightly, so it saves memory for large array sizes.
If you only need to pack 32-bit floats tightly, see [PackedFloat32Array] for a more memory-friendly alternative.
[b]Differences between packed arrays, typed arrays, and untyped arrays:[/b] Packed arrays are generally faster to iterate on and modify compared to a typed array of the same type (e.g. [PackedFloat64Array] versus [code]Array[float][/code]). Also, packed arrays consume less memory. As a downside, packed arrays are less flexible as they don't offer as many convenience methods such as [method Array.map]. Typed arrays are in turn faster to iterate on and modify than untyped arrays.
</description>
<tutorials>
</tutorials>