# Main intention of bang! (performance "vs" memory "vs" mutation)

**URL:** <https://discourse.julialang.org/t/main-intention-of-bang-performance-vs-memory-vs-mutation/14813>\
**Category:** General Usage\
**Tags:** question\
**Created:** [September 11, 2018, 1:52pm UTC](https://discourse.julialang.org/t/main-intention-of-bang-performance-vs-memory-vs-mutation/14813 "2018-09-11T13:52:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![laborg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laborg/32/5474_2.png) [@laborg](https://discourse.julialang.org/u/laborg)\
**Post date:** [September 11, 2018, 1:52pm UTC](https://discourse.julialang.org/t/main-intention-of-bang-performance-vs-memory-vs-mutation/14813/1 "2018-09-11T13:52:32Z")

</div>

Im wondering what Julians mainly **intend or promise** when they offer a bang! version of a function:

1. **Less memory usage**?
2. **Better runtime performance**?
3. **In-place mutation**? (my guess)

It feels like that most of the time all of three intentions are satisfied, but I’ve seen algorithms, where the in-place mutation prevents a better runtime performance. To assess those situations it would be great to have clarity on what to expect from the **bang!**

---

<div class="post-metadata">

**Author:** ![ksmcreynolds](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ksmcreynolds/32/860_2.png) [@ksmcreynolds](https://discourse.julialang.org/u/ksmcreynolds)\
**Post date:** [September 11, 2018, 2:02pm UTC](https://discourse.julialang.org/t/main-intention-of-bang-performance-vs-memory-vs-mutation/14813/2 "2018-09-11T14:02:06Z")

</div>

Per the [documentation](https://docs.julialang.org/en/v1/manual/style-guide/#Append-!-to-names-of-functions-that-modify-their-arguments-1), #3 is correct. It is an indication to the user that at least one of the arguments will be modified. #1 and #2 are often a consequence of in-place mutation (especially for larger objects) because new memory doesn’t have to be allocated (and later garbage collected).
