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

Implement Storage with VecDeque or similar #2

Closed
flo-l opened this issue Dec 18, 2015 · 1 comment
Closed

Implement Storage with VecDeque or similar #2

flo-l opened this issue Dec 18, 2015 · 1 comment

Comments

@flo-l
Copy link
Owner

flo-l commented Dec 18, 2015

Storage is currently implemented using a Vec as a backing storage. This becomes inefficient for huge window sizes, as the whole array needs to be shifted on every call to next() sometimes.

As noted in #1 it's very hard to implement Storage generically over any container.

  • One would lose the ability of Window to deref to a (mut) slice.
  • Window probably has to implement Iterator or Index/IndexMut.

I'd be happy to merge a PR that implements Storage generically over containers if good solutions to the above problems are found and if no functionality gets lost.

Anyway I'd also merge a PR implementing another adaptor, which uses a VecDeque or anything efficient for huge window sizes.

@flo-l
Copy link
Owner Author

flo-l commented Jun 16, 2017

Well, v3.0 and above break the old API to implement this but better. Instead of VecDeque we have Vec with custom Iterators.

@flo-l flo-l closed this as completed Jun 16, 2017
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

1 participant