# Offset array package with offsets in the type?

**URL:** <https://discourse.julialang.org/t/offset-array-package-with-offsets-in-the-type/81772>\
**Category:** General Usage\
**Created:** [May 27, 2022, 9:41am UTC](https://discourse.julialang.org/t/offset-array-package-with-offsets-in-the-type/81772 "2022-05-27T09:41:18Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![N5N3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/n5n3/32/17663_2.png) [@N5N3](https://discourse.julialang.org/u/N5N3)\
**Post date:** [May 27, 2022, 3:39pm UTC](https://discourse.julialang.org/t/offset-array-package-with-offsets-in-the-type/81772/11 "2022-05-27T15:39:02Z")

</div>

> [@nsajko](#):
>
> I think the main improvement is eliminating the extra memory access.

For a single `getindex`/`setindex!` const offset might help.  
But for most cases, we access the elements many times within a function.  
LLVM might not know the offset value, but it knows it won’t change.  
So the overhead could be ignored for most usecase.

---

_[View the full topic](https://discourse.julialang.org/t/offset-array-package-with-offsets-in-the-type/81772)._
