# About dot notation for pre-allocated values a .= f.(x)

**URL:** <https://discourse.julialang.org/t/about-dot-notation-for-pre-allocated-values-a-f-x/95563>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [March 5, 2023, 2:22am UTC](https://discourse.julialang.org/t/about-dot-notation-for-pre-allocated-values-a-f-x/95563 "2023-03-05T02:22:49Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [March 6, 2023, 10:20am UTC](https://discourse.julialang.org/t/about-dot-notation-for-pre-allocated-values-a-f-x/95563/18 "2023-03-06T10:20:44Z")

</div>

Not an answer, but there was a similar report (although in the specific context of an `Any` array) a few days ago here:

> [@Why is identity on an Any vector so much slower when broadcasting than when mapped?](https://discourse.julialang.org/t/why-is-identity-on-an-any-vector-so-much-slower-when-broadcasting-than-when-mapped/95569):
>
> In the REPL I was experimenting with a function that returns Vector{Any}, and I wanted to see how I could make Julia “automatically” change the type to a fixed type without having to specify it myself. I noticed that even though the end result is the same, the performance can vary widely depending on how I do it. I found a simple example that shows an extreme difference: (I’ll suppress the outputs of the vectors because they’re long) julia\> s = Any[i for i in 1:10000] # 3 different ways to do…

I’d be keen to have an answer to your question myself.

---

_[View the full topic](https://discourse.julialang.org/t/about-dot-notation-for-pre-allocated-values-a-f-x/95563)._
