# Enabling High Level Optimizations in Mojo

**URL:** <https://forum.modular.com/t/enabling-high-level-optimizations-in-mojo/1273>\
**Category:** Performance\
**Created:** [April 22, 2025, 1:15am UTC](https://forum.modular.com/t/enabling-high-level-optimizations-in-mojo/1273 "2025-04-22T01:15:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![akneni](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/akneni/32/26_2.png) [@akneni](https://forum.modular.com/u/akneni)\
**Post date:** [April 22, 2025, 1:15am UTC](https://forum.modular.com/t/enabling-high-level-optimizations-in-mojo/1273/1 "2025-04-22T01:15:22Z")

</div>

Is there a way to enable certain high level optimizations in mojo for user defined types? For example, the expression “a \* 0” can be transformed into “0” if a is an integer, but this won’t happen if a is some user defined type (tensor for example) in most languages. Is there a trait that states that any arithmetic operations that work on integers are safe to apply for a specific UDT I create?

---

<div class="post-metadata">

**Author:** ![Brian-M-J](https://avatars.discourse-cdn.com/v4/letter/b/54ee81/32.png) [@Brian-M-J](https://forum.modular.com/u/Brian-M-J)\
**Post date:** [April 22, 2025, 10:31am UTC](https://forum.modular.com/t/enabling-high-level-optimizations-in-mojo/1273/2 "2025-04-22T10:31:17Z")

</div>

Not right now, but the team is working on it. See [this](https://forum.modular.com/t/unlocking-high-performance-in-mojo-through-user-defined-dialects/41) post.
