# Avoiding allocations of small but non-trivial arrays (work array alternative?)

**URL:** <https://discourse.julialang.org/t/avoiding-allocations-of-small-but-non-trivial-arrays-work-array-alternative/90084>\
**Category:** Performance\
**Tags:** question\
**Created:** [November 11, 2022, 12:17am UTC](https://discourse.julialang.org/t/avoiding-allocations-of-small-but-non-trivial-arrays-work-array-alternative/90084 "2022-11-11T00:17:02Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [November 11, 2022, 11:35pm UTC](https://discourse.julialang.org/t/avoiding-allocations-of-small-but-non-trivial-arrays-work-array-alternative/90084/10 "2022-11-11T23:35:34Z")

</div>

There’s a brand new package that seems like made for you. It’s probably not yet registered (you can still use/try it), nor announced:

> **[GitHub - MasonProtter/Bumper.jl: Bring Your Own Stack](https://github.com/MasonProtter/Bumper.jl)**
>
> Bring Your Own Stack. Contribute to MasonProtter/Bumper.jl development by creating an account on GitHub.

In theory Julia could heap-allocate for you and free before exit of barw\_array, but it would be slower. Or allocate on the stack, but it’s limited so dangerous, you don’t know how large the array is going to be, so I doubt that’s a better policy (or check at runtime the size and only stack-allocate if small).

---

_[View the full topic](https://discourse.julialang.org/t/avoiding-allocations-of-small-but-non-trivial-arrays-work-array-alternative/90084)._
