Replies: 1 comment 3 replies
-
Been doing a little benchmarking of my own for other purposes, and came across this library as an alternative. For a basic sum of ints (the benchmark does a sum of an array of 1,000,000 ints --- EDIT: Actually, 100,000 ints; just noticed a small typo in the setup), .NET 8 has massively improved LINQ performance of the Sum() function. In .NET 6, However, while HPCsharp had some small gains in moving from .NET 6 to .NET 8 (being about 13% faster for the most likely use), the vectorization work done in LINQ obliterated the horrid performance previously seen, and actually made it almost twice as fast as HPCsharp. So, to a certain extent, this has become part of the standard library. Though that's incomplete, as LINQ still doesn't handle things like uints or shorts, and HPCsharp has tons of algorithms for other needs. Here's some benchmarks I ran. Most descriptions should be obvious. EnumerableSum uses The HPCsharp methods are using
If your needs can be handled by LINQ in .NET 8, then definitely just use that. Hopefully HPCsharp can learn from the changes that happened in .NET 8 to further improve its performance in the space that LINQ doesn't cover. |
Beta Was this translation helpful? Give feedback.
-
Seems a performant implementation should become part of the standard library
Beta Was this translation helpful? Give feedback.
All reactions