Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster Contigous Views of 4D Arrays #43

Merged
merged 4 commits into from
Apr 20, 2016
Merged

Conversation

JaredCrean2
Copy link
Contributor

This adds some roffset methods for 4D arrays. This makes constructing an contiguous unsafe_view of a 4D array roughly 2.5x faster.

Using the benchmark here:

before:

  0.892318 seconds (35.97 M allocations: 548.845 MB, 2.38% gc time)

after:

  0.332585 seconds

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.0%) to 69.251% when pulling 204cc23 on JaredCrean2:4dspeed into 4ec5569 on JuliaLang:master.

@@ -94,6 +94,32 @@ roffset{T}(a::StridedArray{T,3}, i1::SubsNC, i2::SubsNC, i3::Colon) =
roffset{T}(a::StridedArray{T,3}, i1::SubsNC, i2::SubsNC, i3::SubsNC) =
_offset(i1) * stride(a,1) + _offset(i2) * stride(a,2) + _offset(i3) * stride(a,3)


# 4D (parial)
Copy link
Member

Choose a reason for hiding this comment

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

parial->partial.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops, fixed.

@timholy
Copy link
Member

timholy commented Apr 20, 2016

Following the coveralls link, it looks like at least one of your new functions isn't checked by the test, and moreover the generic splatting fallback isn't tested anymore.

@JaredCrean2
Copy link
Contributor Author

Interesting, I'll add a few more tests

@coveralls
Copy link

Coverage Status

Coverage increased (+6.8%) to 78.036% when pulling 130c79b on JaredCrean2:4dspeed into 4ec5569 on JuliaLang:master.

@timholy timholy merged commit ca5b00a into JuliaArrays:master Apr 20, 2016
@timholy
Copy link
Member

timholy commented Apr 20, 2016

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants