# What's the deal with StaticArrays?

**URL:** <https://discourse.julialang.org/t/whats-the-deal-with-staticarrays/115816>\
**Category:** Performance\
**Tags:** staticarrays\
**Created:** [June 18, 2024, 4:42pm UTC](https://discourse.julialang.org/t/whats-the-deal-with-staticarrays/115816 "2024-06-18T16:42:08Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [June 18, 2024, 7:29pm UTC](https://discourse.julialang.org/t/whats-the-deal-with-staticarrays/115816/4 "2024-06-18T19:29:28Z")

</div>

> [@Elrod](#):
>
> maybe a `eachindex(x) == eachindex(y) || throw(DimensionMismatch("x and y indices don't equal"))` in front of the loop, or something of that sort.

If I do this, will Julia be able to remove bounds checks on `y[i]` despite the loop being on `eachindex(x)` only? Does that solve my most common `eachindex` gripe below then?

> [@Combining \`eachindex\` and \`axes\`?](https://discourse.julialang.org/t/combining-eachindex-and-axes/104442):
>
> One of the things I like about eachindex is that you can give it several arrays and it throws a DimensionMismatch if they have different sizes. I wonder if it would make sense to enable the same with axes(A, d), possibly choosing a different d for each A. With such a syntax, I would write a matrix-vector product like this: function matvec!(y::Vector{T}, A::Matrix, x::Vector) where {T} for i in axes((y, A), (1, 1)) y[i] = zero(T) for j in axes((A, x), (2, 1)) y[i…

---

_[View the full topic](https://discourse.julialang.org/t/whats-the-deal-with-staticarrays/115816)._
