Skip to content

Commit 55b5776

Browse files
Update arrays.md and performance-tips.md (#34194)
* Update arrays.md added link to section, and fixed ordering from "below" to "above" * update @code_warntype uppercases Changing the code in @code_warntype example, and clarifying that uppercases denote red text. * removed some confusing colons * Update doc/src/manual/performance-tips.md Co-Authored-By: Matt Bauman <[email protected]> Co-authored-by: Matt Bauman <[email protected]>
1 parent bff96e2 commit 55b5776

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

doc/src/manual/arrays.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ Base.IndexStyle(::Type{<:MyArray}) = IndexLinear()
852852
This setting will cause `eachindex` iteration over a `MyArray` to use integers. If you don't
853853
specify this trait, the default value `IndexCartesian()` is used.
854854

855-
## Array and Vectorized Operators and Functions
855+
## [Array and Vectorized Operators and Functions](@id man-array-and-vectorized-operators-and-functions)
856856

857857
The following operators are supported for arrays:
858858

@@ -914,7 +914,7 @@ julia> broadcast(+, a, b)
914914
```
915915

916916
[Dotted operators](@ref man-dot-operators) such as `.+` and `.*` are equivalent
917-
to `broadcast` calls (except that they fuse, as described below). There is also a
917+
to `broadcast` calls (except that they fuse, as [described above](@ref man-array-and-vectorized-operators-and-functions)). There is also a
918918
[`broadcast!`](@ref) function to specify an explicit destination (which can also
919919
be accessed in a fusing fashion by `.=` assignment). In fact, `f.(args...)`
920920
is equivalent to `broadcast(f, args...)`, providing a convenient syntax to broadcast any function

doc/src/manual/performance-tips.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -616,8 +616,8 @@ number (the result of [`/`](@ref) operator). This makes it more difficult for th
616616
optimize the body of the loop. There are several possible fixes:
617617

618618
* Initialize `x` with `x = 1.0`
619-
* Declare the type of `x`: `x::Float64 = 1`
620-
* Use an explicit conversion: `x = oneunit(Float64)`
619+
* Declare the type of `x` explicitly as `x::Float64 = 1`
620+
* Use an explicit conversion by `x = oneunit(Float64)`
621621
* Initialize with the first loop iteration, to `x = 1 / rand()`, then loop `for i = 2:10`
622622

623623
## [Separate kernel functions (aka, function barriers)](@id kernel-functions)
@@ -1434,7 +1434,7 @@ julia> @code_warntype f(3.2)
14341434
Variables
14351435
#self#::Core.Compiler.Const(f, false)
14361436
x::Float64
1437-
y::Union{Float64, Int64}
1437+
y::UNION{FLOAT64, INT64}
14381438
14391439
Body::Float64
14401440
1 ─ (y = Main.pos(x))
@@ -1449,8 +1449,8 @@ Interpreting the output of [`@code_warntype`](@ref), like that of its cousins [`
14491449
Your code is being presented in form that has been heavily digested on its way to generating
14501450
compiled machine code. Most of the expressions are annotated by a type, indicated by the `::T`
14511451
(where `T` might be [`Float64`](@ref), for example). The most important characteristic of [`@code_warntype`](@ref)
1452-
is that non-concrete types are displayed in red; in the above example, such output is shown in
1453-
uppercase.
1452+
is that non-concrete types are displayed in red; since this document is written in Markdown, which has no color,
1453+
in this document, red text is denoted by uppercase.
14541454

14551455
At the top, the inferred return type of the function is shown as `Body::Float64`.
14561456
The next lines represent the body of `f` in Julia's SSA IR form.

0 commit comments

Comments
 (0)