Skip to content

Investigate preallocating space for ICollections/IIListProvider in SelectEnumerableIterator methods #18979

Closed

Description

@jamesqo

SelectEnumerableIterator's IIListProvider implementation, e.g. ToArray, ToList, etc. should attempt to preallocate space if the source is an ICollection or IIListProvider. We check before falling back to that iterator if the input is an IList or IPartition, but not if it's one of the parent interfaces.

edit: Adding 'investigate' b/c I'm not sure how common a non-IList ICollection is, or a non-IPartition IIListProvider is. In addition, this may penalize (even if slightly) if the source is neither of those.

Activity

  1. changed the title [-]SelectEnumerableIterator should attempt to preallocate space for ICollections/IIListProvider[/-] [+]Investigate preallocating space for ICollections/IIListProvider in SelectEnumerableIterator methods[/+] on Oct 16, 2016
  2. karelz commented on Oct 17, 2016

    @karelz
    Member
  3. VSadov commented on Nov 10, 2016

    @VSadov
    Member

    Might not be hard to implement, but need to be sure there is a noticeable positive impact in common scenarios.

  4. stephentoub commented on Mar 12, 2019

    @stephentoub
    Member

    This is a theory about a potential perf improvement to potentially investigate. There are many such things that could be looked at... we don't need issues tracking them. If someone finds a performance improvement somewhere and wants to submit a PR for it, that's welcome.

  5. transferred this issue fromdotnet/corefxon Jan 31, 2020
  6. added this to the 3.0 milestone on Jan 31, 2020
  7. ghost locked as resolved and limited conversation to collaborators on Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Linqenhancementhelp wantedtenet-performance

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions