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

Unnecessary memory allocations in restrict_indices #215

Open
raminammour opened this issue Apr 28, 2020 · 1 comment
Open

Unnecessary memory allocations in restrict_indices #215

raminammour opened this issue Apr 28, 2020 · 1 comment

Comments

@raminammour
Copy link
Contributor

raminammour commented Apr 28, 2020

Hello,

I found this when I was puzzled by a discourse question.

The function restrict_indices (called on line 824 in darray.jl, for example, couldn't figure out how to reference here), allocates an array of indices as big as the array that that you are trying to copy. Thus doubling the memory allocations.

Not sure if there is a way around it (just allocating tuples of ranges of indices or the like), but I thought I should file an issue so it doesn't get lost.

Cheers!

@jishnub
Copy link

jishnub commented Apr 29, 2020

Here is the line:

idxs = restrict_indices(Inew, K_mask)

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

No branches or pull requests

2 participants