Skip to content

SqlBulkCopy - ReadWriteColumnValueAsync creates lot of garbage #353

Description

@cmeyertons

ReadWriteColumnValueAsync is written generically, retrieving an object representation of the row's value and passing around object between the read & write. Usually this is a value type that gets boxed, creating GC pressure.

Describe the solution you'd like

I would like ReadWriteColumnValueAsync to leverage generics and the full IDataReader interface to avoid boxing unless absolutely necessary.

This read value portion should also respect IDataReader.GetFieldType and its underlying value getters (GetDecimal, etc.)

Activity

  1. cheenamalhotra commented on Dec 13, 2019

    @cheenamalhotra
    Member

    Hi @cmeyertons

    If you'd like to contribute a PR to improve memory management in this API, feel free to do to so. That way it can be reviewed faster and you can get this improvement merged in driver sooner. We'll definitely consider otherwise but it may not stand up in priority list.

  2. cmeyertons commented on Dec 14, 2019

    @cmeyertons
    ContributorAuthor

    Awesome, already have a fork and some work going. Will keep you posted

  3. cmeyertons commented on Mar 19, 2020

    @cmeyertons
    ContributorAuthor

    @cheenamalhotra would it be possible to move this one out of Waiting for Customer?

    I have had a PR open for a while with outstanding questions. Thank you!

  4. cheenamalhotra commented on Mar 19, 2020

    @cheenamalhotra
    Member

    Could you also update your PR to dotnet/master and resolve conflicts?

  5. linked a pull request that will close this issueSqlBulkCopy - generics to avoid boxing #358on Mar 19, 2020
  6. benrr101 commented on Mar 27, 2024

    @benrr101
    Contributor

    Updating to link to the more recent PR #1048

  7. moved this from To triage to In progress in SqlClient Boardon Dec 23, 2025
  8. moved this from In progress to Backlog in SqlClient Boardon Dec 23, 2025
  9. priyankatiwari08 commented on Sep 17, 2026

    @priyankatiwari08
    Contributor

    /triage

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

    No labels
    No labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions