# Memory allocation and performance

**URL:** <https://discourse.julialang.org/t/memory-allocation-and-performance/42110>\
**Category:** Performance\
**Tags:** memory-allocation\
**Created:** [June 26, 2020, 2:46pm UTC](https://discourse.julialang.org/t/memory-allocation-and-performance/42110 "2020-06-26T14:46:22Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [June 26, 2020, 5:56pm UTC](https://discourse.julialang.org/t/memory-allocation-and-performance/42110/8 "2020-06-26T17:56:39Z")

</div>

> [@Joao\_Barata](#):
>
> So that I may use both types of inputs if I wish? Is there a more appropriate formulation?

Even better, you can do `v::AbstractArray{<:Real}` which will be just as efficient and will accept any array-like container.

Or if you want to accept any array-like container of exactly one dimension, you can do `::AbstractArray{<:Real, 1}`.

See [Passing arrays with unspecified type - #2 by rdeits](https://discourse.julialang.org/t/passing-arrays-with-unspecified-type/39407/2) for related discussion.

---

_[View the full topic](https://discourse.julialang.org/t/memory-allocation-and-performance/42110)._
