-
Notifications
You must be signed in to change notification settings - Fork 292
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
Optimizing Eventsource memory allocations and removing an extra comment. #684
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JRahnama
changed the title
Issue 681 and issue 92
Optimizing Eventsource memory allocations and removing an extra comment.
Aug 11, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I leaved several comments.
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/ProviderBase/SqlConnectionHelper.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientEventSource.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDependencyListener.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommand.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlDependencyListener.cs
Show resolved
Hide resolved
cheenamalhotra
added
the
📈 Performance
Issues that are targeted to performance improvements.
label
Aug 18, 2020
cheenamalhotra
approved these changes
Aug 18, 2020
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/ProviderBase/DbConnectionPool.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnectionHelper.cs
Outdated
Show resolved
Hide resolved
johnnypham
approved these changes
Aug 19, 2020
karinazhou
reviewed
Aug 19, 2020
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientEventSource.cs
Outdated
Show resolved
Hide resolved
karinazhou
reviewed
Aug 19, 2020
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientEventSource.cs
Outdated
Show resolved
Hide resolved
karinazhou
approved these changes
Aug 20, 2020
cheenamalhotra
requested review from
cheenamalhotra,
karinazhou and
johnnypham
August 21, 2020 01:30
johnnypham
approved these changes
Aug 21, 2020
cheenamalhotra
approved these changes
Aug 21, 2020
# Conflicts: # src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.NetCoreApp.cs # src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs
DavoudEshtehari
approved these changes
Aug 21, 2020
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnection.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnectionHelper.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/ProviderBase/DbConnectionPool.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/ProviderBase/SqlConnectionHelper.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/Server/SmiEventSink_Default.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlError.cs
Outdated
Show resolved
Hide resolved
…lient into Issue-92-issue-681
karinazhou
approved these changes
Aug 21, 2020
TrayanZapryanov
pushed a commit
to TrayanZapryanov/SqlClient
that referenced
this pull request
Aug 31, 2020
TrayanZapryanov
added a commit
to TrayanZapryanov/SqlClient
that referenced
this pull request
Aug 31, 2020
…ra comment. (dotnet#684)" This reverts commit 0927024.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is addressing Issue#92 and Issue#681.
Issue#92 regarding
// call OnError outside of _ErrorCollectionLock to avoid deadlock
comment, apparently the lock is moved inside a function calledGetFullErrorAndWarningCollection
to avoid deadlocks. comment is safely removed.Issue#681: This is a first step of making EventSource optimized. all
ToString()
methods are removed from eventsource related code implementation, if possible, and moved inside EventSource class inside theif checkers
to see if the log is requested, for perf improvement. all arguments passed toNonEvent
functions are checked fornull
values and null-coalescing operator is applied inside EventSource class.New methods have been added to EventSource class overloads. This methods do not have the
IsEnabled
checker inside them. They are used whenIsEnabled
is called out of EventSource class, for instance when a setup was needed to make one or more variables to be passed to EventSource functions. These methods have the bare name such as TraceEvent etc.Older methods in
NonEvent
overloads region of EventSource class, the one withIsEnabled
checker inside, a prefix ofTry
is added to the old names to distinguish between two different kind of overloads.There were places that log levels, such as "INFO' or "API" and etc. as a separate string to the string.Format method, I have combined those two strings to be one and use a different overload from EventSource.
At some places while using null coalescing the log message was passing a string containing "null" or "", in possible cases I have removed them as the null checker is applied inside
EventSource
class.