Skip to content

Conversation

@natema
Copy link
Contributor

@natema natema commented Jun 1, 2020

This commit improves an ambiguous sentence in the Performance Tips page.

In the section Access arrays in memory order, along columns, there is the final sentence

(Of course, if you just do f.(x) then it is as fast as fdot(x) in this example, but in many contexts it is more convenient to just sprinkle some dots in your expressions rather than defining a separate function for each vectorized operation.)

This is a bit confusing. What we want to say is that

  • using the dot notation is faster in the given example, but in general it will not be the case,
  • even though in general the dot notation is not the most performant approach, in several contexts it is more convenient.

natema added 3 commits June 1, 2020 11:42
This commit improves an ambiguous sentence in the [Performance Tips](https://docs.julialang.org/en/v1/manual/performance-tips/) page.

In the section [Access arrays in memory order, along columns](https://docs.julialang.org/en/v1/manual/performance-tips/#More-dots:-Fuse-vectorized-operations-1), there is the final sentence
> (Of course, if you just do `f.(x)` then it is as fast as `fdot(x)` in this example, but in many contexts it is more convenient to just sprinkle some dots in your expressions rather than defining a separate function for each vectorized operation.)

This is a bit confusing.  What we want to say is that
- using the dot notation is faster in the given example, but in general it will not be the case,
- even though in general the dot notation is not the most performant approach, in several contexts it is more convenient.
This commit improves an ambiguous sentence in the [Performance Tips](https://docs.julialang.org/en/v1/manual/performance-tips/) page.

In the section [Access arrays in memory order, along columns](https://docs.julialang.org/en/v1/manual/performance-tips/#More-dots:-Fuse-vectorized-operations-1), there is the final sentence
> (Of course, if you just do `f.(x)` then it is as fast as `fdot(x)` in this example, but in many contexts it is more convenient to just sprinkle some dots in your expressions rather than defining a separate function for each vectorized operation.)

This is a bit confusing.  What we want to say is that
- using the dot notation is faster in the given example, but in general it will not be the case,
- even though in general the dot notation is not the most performant approach, in several contexts it is more convenient.
Fixed by running git rebase --whitespace=fix HEAD~1 and then merging.
@ViralBShah ViralBShah added the docs This change adds or pertains to documentation label Jun 1, 2020
some dots in your expressions rather than defining a separate function
for each vectorized operation.)
a new temporary array and executes in a separate loop.
Note also that, while `f.(x)` is as fast as `fdot(x)` in the above example, in general defining a separate function will lead to improved performance. Nevertheless, in many contexts it is more convenient to just sprinkle some dots in your expressions rather than defining a separate function for each vectorized operation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in general defining a separate function will lead to improved performance.

This seems to change the meaning of what was intended here.

@mbauman
Copy link
Member

mbauman commented Jun 3, 2020

  • using the dot notation is faster in the given example, but in general it will not be the case,
  • even though in general the dot notation is not the most performant approach, in several contexts it is more convenient.

This is definitely not how we want to frame this. In general, it should be the same speed or faster — especially as it is then able to fuse with surrounding expressions. If you have specific examples where that's not the case, please file bugs.

@ViralBShah ViralBShah closed this Jun 4, 2020
@natema
Copy link
Contributor Author

natema commented Jun 4, 2020

Thanks for the feedback. I get that my rewriting of the sentence doesn't go in the right direction. It is still unclear to me, though, how the original sentence serves the intended message. I guess that I should ask in the forum for clarifications regarding my confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs This change adds or pertains to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants