This repository was archived by the owner on Oct 3, 2019. It is now read-only.
Added Cistern/System Linq plus change to array #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @agocke
Not really much of a serious pull request, more just a point of contact, given that you have been interested in IEnumerable and performance...
Anyway, first things first... a little critique of your code... you are not replicating the functionality of
List<>.Enumerator
(in fact it can't be) because you are not honouring the "version" number. This is used if the collection is modified which enumerator is occurring (i.e. this protects where a Count might initially be requested, which would allocate a buffer, and then the collection has it's size changed... maybe? Anyway, it is functionality that exists that your enumerator doesn't support). So I changed the structure to an array which doesn't suffer from this...So secondly.... I have been working on a replacement for Linq-to-objects called Cistern.Linq (as well replacing F#'s Seq, built on top of that). It's not complete, but functionality has been copied from (or forwards calls to) the original implementations, so it should be 100% functional (albeit, probably bug ridden! Although it does run the corefx linq and fsharp seq test suites...)
So just for "show" I added it to your benchmark suite, where it beats everything (by cheating basically, optimized for SIMD), but that is really just an edge case...
You can see some other comparisons to LinqOptimizer which also point to this file, or to LinqFaster or you can have a peruse in the source code in the benchmarks project where benchmark results have been added in source control, such as this.
Anyway, it's "90% finished", which given it's deep roots means I'll be finished sometime around 2022...
But hey, you never know. I've been trying to spark anyone's interest for years... Maybe you'll be the one :-)