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

Subarray memory reduction #13

Merged
merged 2 commits into from Jun 21, 2016

Conversation

Hydrotoast
Copy link
Contributor

Reducing total memory usage from 329MB to 268MB for the ml100k.jl test by using SubArrays within Julia.

The problem is that given a matrix X, accessing a column or row of the matrix X[:, c] will allocate a completely new array with the contents of X[:, c]. Julia can avoid this by using subarrays which are views/references to the subarray with the matrix. To use a subarray and avoid memory allocation: sub(X, :, c).

To support both types of SubArray and DenseVector, we convert some types to StridedVector which is essentially a union of the two.

@coveralls
Copy link

coveralls commented Jun 16, 2016

Coverage Status

Coverage remained the same at 96.552% when pulling 3849ceb on Hydrotoast:subarray-memory-reduction into fa6c4f7 on btwardow:master.

@btwardow
Copy link
Owner

Nice. It sth new for me. Thanks 👍

@btwardow btwardow merged commit eb57cf4 into btwardow:master Jun 21, 2016
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