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

Ix optimizations #237

Merged
merged 95 commits into from
Sep 17, 2016
Merged

Ix optimizations #237

merged 95 commits into from
Sep 17, 2016

Conversation

clairernovotny
Copy link
Contributor

@clairernovotny clairernovotny commented Jul 20, 2016

This PR is to optimize Ix Async by incorporating the patterns used in https://github.com/dotnet/corefx/tree/master/src/System.Linq/src/System/Linq, taking advantage of the thought leadership and performance reviews of that codebase.

{
var result = await ToArrayWithLength(source, cancellationToken)
.ConfigureAwait(false);
Array.Resize(ref result.array, result.length);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can move this to a ToArray method onArrayWithLength<T>.

@clairernovotny
Copy link
Contributor Author

/cc @aelij for any code review feedback


public Task<int> GetCountAsync(bool onlyIfCheap, CancellationToken cancellationToken)
{
return Task.FromResult(source.Count());
Copy link
Collaborator

@danielcweber danielcweber Aug 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Count instead of Count() since source is an IList.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants