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

Consider optimizations to FindIndex based on the underlying type #697

Open
Treit opened this issue Oct 23, 2024 · 0 comments
Open

Consider optimizations to FindIndex based on the underlying type #697

Treit opened this issue Oct 23, 2024 · 0 comments

Comments

@Treit
Copy link

Treit commented Oct 23, 2024

List<T> and T[] support a FindIndex operation.

The SuperLinq FindIndex operation could detect if the underlying type is one of these and call the native implementation as an optimization.

Currently, benchmarks shows that calling someList.ToList().FindIndex(predicate) is actually faster than the SuperLinq implmentation, although of course it allocates a lot more memory.

Invoking the underlying method would provide better performance and avoid the memory allocation of calling ToList() to get access to the faster FindIndex method.

@Treit Treit changed the title Consider optimizations to IndexOf based on the underlying type Consider optimizations to FindIndex based on the underlying type Oct 23, 2024
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