Skip to content

Commit

Permalink
Remove keyword argument performance tips (#24987)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas authored and JeffBezanson committed Nov 10, 2018
1 parent 151f853 commit e01733b
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions doc/src/manual/performance-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,26 +481,6 @@ c = (b + 1.0f0)::Complex{T}
does not hinder performance (but does not help either) since the compiler can determine the type of `c`
at the time `k` is compiled.

### Declare types of keyword arguments

Keyword arguments can have declared types:

```julia
function with_keyword(x; name::Int = 1)
...
end
```

Functions are specialized on the types of keyword arguments, so these declarations will not affect
performance of code inside the function. However, they will reduce the overhead of calls to the
function that include keyword arguments.

Functions with keyword arguments have near-zero overhead for call sites that pass only positional
arguments.

Passing dynamic lists of keyword arguments, as in `f(x; keywords...)`, can be slow and should
be avoided in performance-sensitive code.

## Break functions into multiple definitions

Writing a function as many small definitions allows the compiler to directly call the most applicable
Expand Down

0 comments on commit e01733b

Please sign in to comment.