# How to preallocate and reuse buffers for oft-repeated computation?

**URL:** <https://discourse.julialang.org/t/how-to-preallocate-and-reuse-buffers-for-oft-repeated-computation/100915>\
**Category:** General Usage\
**Tags:** question, performance, memory-allocation, profiling, speed-optimization\
**Created:** [June 27, 2023, 9:24pm UTC](https://discourse.julialang.org/t/how-to-preallocate-and-reuse-buffers-for-oft-repeated-computation/100915 "2023-06-27T21:24:22Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [June 27, 2023, 11:57pm UTC](https://discourse.julialang.org/t/how-to-preallocate-and-reuse-buffers-for-oft-repeated-computation/100915/12 "2023-06-27T23:57:39Z")

</div>

You can find some examples on this thread, with the most common patterns to avoid, and what to do: [Common allocation mistakes](https://discourse.julialang.org/t/common-allocation-mistakes/66127)

---

_[View the full topic](https://discourse.julialang.org/t/how-to-preallocate-and-reuse-buffers-for-oft-repeated-computation/100915)._
