# 请教一下关于Bytes

**URL:** <https://taolun.moonbitlang.com/t/topic/1107>\
**Category:** 欢迎\
**Created:** [2024 年12 月 28 日 08:21 UTC](https://taolun.moonbitlang.com/t/topic/1107 "2024-12-28T08:21:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

作者： ![hackwaly](https://taolun.moonbitlang.com/user_avatar/taolun.moonbitlang.com/hackwaly/32/60_2.png) [@hackwaly](https://taolun.moonbitlang.com/u/hackwaly)\
发布日期： [2025 年3 月 1 日 15:24 UTC](https://taolun.moonbitlang.com/t/topic/1107/2 "2025-03-01T15:24:00Z")

</div>

Bytes在layout上和FixedArray[Byte]是等价的，都相当于c里的`byte[]`。但之后Bytes我们会调整为immutable的。

从性能优化的角度来讲，Bytes的内存layout相较于FixedArray[Int]来说更紧凑一些，locality更好，但是FixedArray[Int]是native aligned的，访存延迟上可能会有一定的优势。

---

_[View the full topic](https://taolun.moonbitlang.com/t/topic/1107)._
