# Removing \`2 allocations: 64 bytes\`

**URL:** <https://discourse.julialang.org/t/removing-2-allocations-64-bytes/10095>\
**Category:** General Usage\
**Created:** [April 1, 2018, 6:22am UTC](https://discourse.julialang.org/t/removing-2-allocations-64-bytes/10095 "2018-04-01T06:22:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [April 1, 2018, 6:22am UTC](https://discourse.julialang.org/t/removing-2-allocations-64-bytes/10095/1 "2018-04-01T06:22:51Z")

</div>

I am trying to make a super-fast QR decomposition with 0 allocations if possible. At this point [https://github.com/mohamed82008/InplaceQR.jl](https://github.com/mohamed82008/InplaceQR.jl) is at `2 allocations: 64 bytes` and within a factor of 8 of LAPACK’s multi-threaded `qrfact!` when using `julia.exe --check-bounds=no -O3` so I am happy with it, but just curious where are these 2 allocations coming from? Is it just the REPL?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [April 1, 2018, 6:30am UTC](https://discourse.julialang.org/t/removing-2-allocations-64-bytes/10095/2 "2018-04-01T06:30:24Z")

</div>

> [@mohamed82008](#):
>
> but just curious where are these 2 allocations coming from? Is it just the REPL?

That’s probably just the heap allocation of the small immutables for the returned types. In hot loops it won’t allocate since they stay on the stack, but when returned into main they are placed on the heap since anything can happen. This doesn’t actually effect code performance though.

---

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [April 1, 2018, 6:34am UTC](https://discourse.julialang.org/t/removing-2-allocations-64-bytes/10095/3 "2018-04-01T06:34:36Z")

</div>

I see, thanks.
