Skip to content

Commit

Permalink
Document effect of type aliases on global level (#42666)
Browse files Browse the repository at this point in the history
Adds the sentence @JeffBezanson proposed to the documentation and solves #30824.
  • Loading branch information
tomtuamnuq authored Oct 19, 2021
1 parent dc74954 commit b55bfec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/src/manual/performance-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ The functions should take arguments, instead of operating directly on global var
## Avoid global variables

A global variable might have its value, and therefore its type, change at any point. This makes
it difficult for the compiler to optimize code using global variables. Variables should be local,
or passed as arguments to functions, whenever possible.
it difficult for the compiler to optimize code using global variables. This also applies to type-valued variables, i.e. type aliases on the global level.
Variables should be local, or passed as arguments to functions, whenever possible.


We find that global names are frequently constants, and declaring them as such greatly improves
Expand Down

0 comments on commit b55bfec

Please sign in to comment.