# Making efficient some small subroutines

**URL:** <https://discourse.julialang.org/t/making-efficient-some-small-subroutines/38917>\
**Category:** Performance\
**Created:** [May 6, 2020, 10:41pm UTC](https://discourse.julialang.org/t/making-efficient-some-small-subroutines/38917 "2020-05-06T22:41:31Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![waralex](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/waralex/32/13415_2.png) [@waralex](https://discourse.julialang.org/u/waralex)\
**Post date:** [May 7, 2020, 6:07pm UTC](https://discourse.julialang.org/t/making-efficient-some-small-subroutines/38917/13 "2020-05-07T18:07:56Z")

</div>

Another option, perhaps more universal , is not to create a matrix immediately, but to fill the same arrays I, J, V in the main calculation loop and create a sparse matrix from them after the loop. Just in case I, J, V are arrays such that `D[I[k], J[k]] = V[k]`

---

_[View the full topic](https://discourse.julialang.org/t/making-efficient-some-small-subroutines/38917)._
