You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got two n-by-3 arrays and I'd like to find the fastest method of computing the row-by-row dot products. einsum is faster than multiplying and summing up, so I compared row-dot-products and column-dot-products with the contiguous transposed arrays. The results:
Apparently, column dot products of 3-by-n matrices are never worse, and up to 2.3 times as fast as row dot products of n-by-3 matrices.
Any idea why that is? We're perhaps venturing into the area of cache hits/misses here.
Not sure, you would have to dig in the actual code I think. My expectation is caching/memory speed is at least the reason why it has the same speed for large n. For small n it is likely you are only measuring overheads. For intermediate n, I expect the actual code is somewhat different. Maybe due to SSE usage. If you really want to know, you probably need to look at and compare the result of perf or so (or maybe just look by hand at the code that gets called).
Activity
seberg commentedon Nov 25, 2019
Not sure, you would have to dig in the actual code I think. My expectation is caching/memory speed is at least the reason why it has the same speed for large
n. For smallnit is likely you are only measuring overheads. For intermediaten, I expect the actual code is somewhat different. Maybe due to SSE usage. If you really want to know, you probably need to look at and compare the result ofperfor so (or maybe just look by hand at the code that gets called).rossbar commentedon Jul 18, 2020
I'm going to go ahead and close this due to lack of followup. Please feel free to reopen if you are interested in investigating in more detail.
DOC: Avoid unwanted doctest on PR numpy#14979
DOC: 2nd try: Avoid unwanted doctest on PR numpy#14979
DOC: 3rd try: Avoid unwanted doctest on PR numpy#14979
DOC: 4th try: Avoid unwanted doctest on PR numpy#14979
DOC: 5th try: Avoid unwanted doctest on PR numpy#14979
DOC: Avoid unwanted doctest on PR numpy#14979
DOC: 2nd try: Avoid unwanted doctest on PR numpy#14979
DOC: 3rd try: Avoid unwanted doctest on PR numpy#14979
DOC: 4th try: Avoid unwanted doctest on PR numpy#14979
DOC: 5th try: Avoid unwanted doctest on PR numpy#14979