Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory: Eliminate use of HasFlag #137

Closed
bgrainger opened this issue Nov 15, 2016 · 1 comment
Closed

Memory: Eliminate use of HasFlag #137

bgrainger opened this issue Nov 15, 2016 · 1 comment

Comments

@bgrainger
Copy link
Member

@bgrainger bgrainger commented Nov 15, 2016

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.)

@bgrainger
Copy link
Member Author

@bgrainger bgrainger commented Nov 21, 2016

Fixed in 0.7.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant