# Why so many allocations in the loop on partition

**URL:** <https://discourse.julialang.org/t/why-so-many-allocations-in-the-loop-on-partition/101606>\
**Category:** General Usage\
**Tags:** performance, allocations, itertoolspartition\
**Created:** [July 14, 2023, 8:05am UTC](https://discourse.julialang.org/t/why-so-many-allocations-in-the-loop-on-partition/101606 "2023-07-14T08:05:06Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![rocco\_sprmnt21](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rocco_sprmnt21/32/20127_2.png) [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Post date:** [July 14, 2023, 1:05pm UTC](https://discourse.julialang.org/t/why-so-many-allocations-in-the-loop-on-partition/101606/3 "2023-07-14T13:05:26Z")

</div>

How do you upload the version with the optimized function, to do this test?  
If it’s not too complicated, what are the changes made to make the function more efficient?  
My question comes from trying to solve [this problem](https://discourse.julialang.org/t/optimizing-dinucleotides-count-in-a-dna-sequence-type-longdna/101583/9)

---

_[View the full topic](https://discourse.julialang.org/t/why-so-many-allocations-in-the-loop-on-partition/101606)._
