LinqFaster
LinqFaster copied to clipboard
- Convert SumF functions for Array, Span, and List into a generic function
- Convert SumF function into a generic function
- Add new managed types (sbyte, byte, short, ushort, int, uint, long, ulong)
- Add tests for some of the new types
- Add new Benchmark tests
This fixes #18 [Bug] using SumS on a ushort[] throws System.InvalidCastException #18
Hey Simon, wanted to say thanks for all the experiments you are doing here. I'll need to some time to review/test some of this stuff out, and I'm pretty busy with family/work all the time so it might take a while. I'll try to take a deep look in a few days and let you know what I think.
wanted to say thanks for all the experiments you are doing here.
No worries, Now that I have the templates in place, I can burn through the other types pretty quickly
I would hold off on doing too much work until I've had some time to review and test. I don't want you to write a million lines of code and then I end up not using them!
Hey Simon, wanted to say thanks for all the experiments you are doing here. I'll need to some time to review/test some of this stuff out, and I'm pretty busy with family/work all the time so it might take a while. I'll try to take a deep look in a few days and let you know what I think.
Just found a bog "No-no" in some of the "Optimisations" I've done When using the List's I have done the following
int sourceCount = source.Count;
T2 a = p.Zero();
checked
{
for (int index = 0; index < sourceCount; index++)
{
a = p.Add(a, source[index]);
}
}
The big "No-No" is on the int sourceCount = source.Count;
as the Items in the List could be changed externally "Darn threading !". One way would be to lock the list, another is to put the count Back into the for loop,
I'll go with the latter, I think this may also need to be done for the IReadOnlyList but I'm not sure.
// Note: Lists can have items added and removed whilst these API's are in use
// The IReadOnlyList<T> represents a list in which the _number_ and _order_ of list elements is read-only.
//
int sourceCount = source.Count;
is a non optimization on List anyway. Did you mean IList?
int sourceCount = source.Count;
is a non optimization on List anyway. Did you mean IList?
No on the List<T>
it did show "Some" improvement....
No idea why AppVeyor is complaining, It runs on my machine !!