Visitar URL original
Ix optimizations by clairernovotny · Pull Request #237 · dotnet/reactive · GitHub
Skip to content

Ix optimizations - #237

Merged
clairernovotny merged 95 commits into
masterfrom
ix-optimizations
Sep 17, 2016
Merged

clairernovotny merged 95 commits into
masterfrom
ix-optimizations

Conversation

@clairernovotny

@clairernovotny clairernovotny commented Jul 20, 2016 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor Author

/cc @aelij for any code review feedback


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

@danielcweber danielcweber Aug 16, 2016 •

Copy link
Copy Markdown
Collaborator

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