# Keyword arguments reduce performance

**URL:** <https://discourse.julialang.org/t/keyword-arguments-reduce-performance/127224>\
**Category:** General Usage\
**Created:** [March 21, 2025, 2:32pm UTC](https://discourse.julialang.org/t/keyword-arguments-reduce-performance/127224 "2025-03-21T14:32:35Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![danielwe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielwe/32/35657_2.png) [@danielwe](https://discourse.julialang.org/u/danielwe)\
**Post date:** [March 22, 2025, 4:28pm UTC](https://discourse.julialang.org/t/keyword-arguments-reduce-performance/127224/10 "2025-03-22T16:28:19Z")

</div>

Performance changing dramatically due to function redefinition—that smells like [problem with the unreliable approximation of `Core.Compiler.return_type` · Issue #35800 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/35800) to me. See the following recent thread for another example exposing this: [Type instability in nested quadgk calls](https://discourse.julialang.org/t/type-instability-in-nested-quadgk-calls/126667).

I haven’t run your code yet, will hopefully get around to that later. In any case, you should note that `@specialize(arg)` in a function signature doesn’t do what you think it does, in fact it doesn’t do anything at all (see [Essentials · The Julia Language](https://docs.julialang.org/en/v1/base/base/#Base.@nospecialize) for details). The way to force specialization is to add a type parameter in the function signature, like `function foo(x::T, y) where {T}`.

---

_[View the full topic](https://discourse.julialang.org/t/keyword-arguments-reduce-performance/127224)._
