# How to improve performance in nested loops

**URL:** https://discourse.julialang.org/t/how-to-improve-performance-in-nested-loops/70407
**Category:** Performance
**Tags:** question, performance
**Created:** [October 26, 2021, 2:14pm UTC](https://discourse.julialang.org/t/how-to-improve-performance-in-nested-loops/70407 "2021-10-26T14:14:43Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![mcabbott](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcabbott/32/6603_2.png) [@mcabbott](https://discourse.julialang.org/u/mcabbott)
#### Post date: [October 26, 2021, 2:46pm UTC](https://discourse.julialang.org/t/how-to-improve-performance-in-nested-loops/70407/3 "2021-10-26T14:46:49Z")

</div>

Can you avoid having a vector of vectors, and resizing half of them? Perhaps if these are columns of a matrix, and you keep track of which to keep, and what to append, then at the end you can make a new matrix which has one more row.

---

_[View the full topic](https://discourse.julialang.org/t/how-to-improve-performance-in-nested-loops/70407)._
