# Performance & Profiling Tips for Beginner Code

**URL:** <https://discourse.julialang.org/t/performance-profiling-tips-for-beginner-code/100585>\
**Category:** Performance\
**Tags:** performance, profiling\
**Created:** [June 20, 2023, 2:56am UTC](https://discourse.julialang.org/t/performance-profiling-tips-for-beginner-code/100585 "2023-06-20T02:56:38Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [June 20, 2023, 11:22am UTC](https://discourse.julialang.org/t/performance-profiling-tips-for-beginner-code/100585/7 "2023-06-20T11:22:35Z")

</div>

A good idea is to check for the performance of each function separately, for instance using

```julia
julia> @btime mat_z(... inputs ...)

```

where you provide to the function some representative inputs. When these are functions called multiple times within loops, that is important, and easier to understand than the complete profile.

The most important optimizations will come from removing temporary allocations, as mentioned above. This post may help: [Common allocation mistakes](https://discourse.julialang.org/t/common-allocation-mistakes/66127)

---

_[View the full topic](https://discourse.julialang.org/t/performance-profiling-tips-for-beginner-code/100585)._
