# Efficiency of abstract types vs \`Any\`

**URL:** <https://discourse.julialang.org/t/efficiency-of-abstract-types-vs-any/129518>\
**Category:** General Usage\
**Tags:** question\
**Created:** [June 1, 2025, 8:50am UTC](https://discourse.julialang.org/t/efficiency-of-abstract-types-vs-any/129518 "2025-06-01T08:50:15Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)\
**Post date:** [June 13, 2025, 11:02pm UTC](https://discourse.julialang.org/t/efficiency-of-abstract-types-vs-any/129518/15 "2025-06-13T23:02:21Z")

</div>

Here’s 2 comments showing abstract element types allowing type inference to be improved by inferring a (inexplicably high) number of dispatched methods. `Any[...]` wasn’t demonstrated there but it would’ve been more vulnerable to poor type inference than `Val[...]` the same way `Val[...]` was more vulnerable than `(Val{T} where T<:SomeTypeUnion)[...]`.

[Performance discrepancy for different ways of piping/composing functions for handling runtime dispatch - General Usage / Performance - Julia Programming Language](https://discourse.julialang.org/t/performance-discrepancy-for-different-ways-of-piping-composing-functions-for-handling-runtime-dispatch/129773/9)

---

_[View the full topic](https://discourse.julialang.org/t/efficiency-of-abstract-types-vs-any/129518)._
