Skip to content

[perf] System.Data.SqlClient allocates lots of closures with ContinueWith #16994

@jamesqo

Description

@jamesqo

Ran this grep query:

grep --include='*.cs' --exclude-dir=tests --exclude-dir=ref -r 'ContinueWith[^(]*(([^,]*)' .

It printed out the following results: https://gist.github.com/anonymous/7afb47c97f2f632c7ddf963111ad3136

The closure in WinHttpHandler is fixed by dotnet/corefx#7785, but there appear to be a bunch of them in System.Data.SqlClient that could be removed. Opening up a tracking issue to remove them (which I'll do myself).


edit: Just realized I wasn't picking up on some of them, because most are written in the form:

task.ContinueWith(t => ...)

rather than

task.ContinueWith((t) => ...)

so I ran a new query, which seems to pick up more matches. See: https://gist.github.com/anonymous/14aa1dea4fe3a26e42e338c5b30b09b4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions