# Zygote performances for simple function

**URL:** <https://discourse.julialang.org/t/zygote-performances-for-simple-function/104465>\
**Category:** Performance\
**Created:** [October 1, 2023, 1:39pm UTC](https://discourse.julialang.org/t/zygote-performances-for-simple-function/104465 "2023-10-01T13:39:20Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)\
**Post date:** [October 1, 2023, 8:50pm UTC](https://discourse.julialang.org/t/zygote-performances-for-simple-function/104465/11 "2023-10-01T20:50:06Z")

</div>

At least for those two examples it works, but perhaps you have other constraints that weren’t expressed in the original post.

Back to the allocations, I had a look at both the generated Julia and LLVM IR with Cthulhu. It appears that replacing `-x` with a different operation (e.g. `sin(x)`) has the same outcome. Yet I’m only able to see one allocation at either the Julia or LLVM level. It feels like this is somehow hitting some compiler heuristic, but I can’t figure out what.

---

_[View the full topic](https://discourse.julialang.org/t/zygote-performances-for-simple-function/104465)._
