Skip to content

Memory: Eliminate use of HasFlag #137

@bgrainger

Description

@bgrainger

The Visual Studio .NET Memory Allocation profiler shows columnDefinition.ColumnFlags.HasFlag(ColumnFlags.Unsigned) (in MySqlDataReader) as allocating a 4-byte ColumnFlags object. The equivalent bitwise test (columnDefinition.ColumnFlags & ColumnFlags.Unsigned) != 0 has no allocations.

Replace Enum.HasFlag with the equivalent bitwise test in any code that might be called frequently during data access.

(Wait for #136 since it'll be rearranging a lot of the usages of HasFlag.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions