Skip to content
This repository has been archived by the owner on May 18, 2023. It is now read-only.

Better implementation of SparseArray. #120

Merged
merged 13 commits into from Nov 22, 2016
Merged

Better implementation of SparseArray. #120

merged 13 commits into from Nov 22, 2016

Conversation

nkronenfeld
Copy link
Contributor

I tried for a while to fix this while staying within the scala collections framework.

The problem is, SparseArrays really aren't normal collections - it's the attempt to view them as such that causes a lot of the unneeded materialization.

When that wouldn't work, I looked at how Array itself was implemented. It isn't part of the scala collections framework (of course), but has wrappers to help it fit therein.

I have not made said wrappers - they are a lot of extraneous boilerplate code with no current use, as far as I could tell.

Note: I have changed the signature for creating a sparse array. I don't think anyone but me is currently using it outside spark itself (since it was only recently exposed at all, and that was for me), but it's possible there are ripple effects in some examples and salt modules.

Fixes #119

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.9%) to 98.113% when pulling 66efc89 on sparse-array-work into 18a4670 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 71d7300 on sparse-array-work into 18a4670 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling e124a28 on sparse-array-work into 18a4670 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 8593486 on sparse-array-work into 18a4670 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling fc47eb1 on sparse-array-work into 18a4670 on master.

@nkronenfeld
Copy link
Contributor Author

Note to self: Check if anything but the reduce function actually cares about the default being a zero, as opposed to the most common value. Check if anything is using the reduce function. If the answer to both those questions is "no", we can get rid of this assumption by eliminating the reduce function.

…ings with it that are non-standard-seq or materializing, and no one needs it.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 7119b77 on sparse-array-work into 18a4670 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 99.64% when pulling 8197186 on sparse-array-work into 18a4670 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 7131495 on sparse-array-work into 18a4670 on master.

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

Successfully merging this pull request may close these issues.

Sparse arrays are insufficient for tile transformations
3 participants