Small optimizations#74
Merged
SergeiPavlov merged 5 commits intomaster-servicetitanfrom Jul 18, 2022
Merged
Conversation
botinko
approved these changes
Jul 18, 2022
SergeiPavlov
added a commit
that referenced
this pull request
Jul 21, 2022
* Optimize VisitMethodCall() * Optimize Provider constructor * Use Array.Empty<T>() instead of allocating Empty array * Get rid of unused PriorityQueue<> class * VisitNullable()
SergeiPavlov
pushed a commit
that referenced
this pull request
Jul 18, 2023
Small optimizations (#74)
SergeiPavlov
added a commit
that referenced
this pull request
Jul 18, 2023
* Small optimizations (#74) * Optimize VisitMethodCall() * Optimize Provider constructor * Use Array.Empty<T>() instead of allocating Empty array * Get rid of unused PriorityQueue<> class * VisitNullable() * make VisitNullable() private * SqlServer: Both US English and British English are considered english * Improve changelog * Change version to next developing * Add changelog file * After merge changes - TestHelper.AddValueRow() is for all build targets - SqlSessionHandler: shared code for async and sync Execute + renames - TemporaryTableManager: removed unused code - CommandFactory: removed commented code - DomainConfuguration: fixed bug of MaxNumberOfConditions value not being validated (added tests to make sure that validation happens) - Test for temp table popupation - Updated MaxQueryParameterCount for Oracle and PostgreSQL 9.0+ * Add new storage configurations + enrich supported databases list * Fixed bad merge results * Remove usage of obsolete SqlInsert.Values from object cloning * Changelog improved * Fix build --------- Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net>
SergeiPavlov
added a commit
that referenced
this pull request
Jul 19, 2023
* Use C#9 Covariant return types feature for Clone() implementation for more type safety * Make SqlNodeCloneContext readonly struct * Continue refactoring * Refactor other Clone() * Get rid of IsNullReference() in modified lines * Small optimizations (#74) * Optimize VisitMethodCall() * Optimize Provider constructor * Use Array.Empty<T>() instead of allocating Empty array * Get rid of unused PriorityQueue<> class * VisitNullable() * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlUserFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlCustomFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * make VisitNullable() private * ToArray(t.tables.Length) for consistency * SqlServer: Both US English and British English are considered english * Improve changelog * Fix build * Change version to next developing * Add changelog file * After merge changes - TestHelper.AddValueRow() is for all build targets - SqlSessionHandler: shared code for async and sync Execute + renames - TemporaryTableManager: removed unused code - CommandFactory: removed commented code - DomainConfuguration: fixed bug of MaxNumberOfConditions value not being validated (added tests to make sure that validation happens) - Test for temp table popupation - Updated MaxQueryParameterCount for Oracle and PostgreSQL 9.0+ * Add new storage configurations + enrich supported databases list * Fixed bad merge results * Remove usage of obsolete SqlInsert.Values from object cloning * Changelog improved * Update Orm/Xtensive.Orm/Sql/Internals/SqlNodeCloneContext.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Fix SqlTruncateTable.Clone() * Fix build * Refactor SqlInsert.Clone() * Changelog improved --------- Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net>
SergeiPavlov
added a commit
that referenced
this pull request
Jul 27, 2023
* Use C#9 Covariant return types feature for Clone() implementation for more type safety * Make SqlNodeCloneContext readonly struct * Continue refactoring * Refactor other Clone() * Get rid of IsNullReference() in modified lines * Small optimizations (#74) * Optimize VisitMethodCall() * Optimize Provider constructor * Use Array.Empty<T>() instead of allocating Empty array * Get rid of unused PriorityQueue<> class * VisitNullable() * Avoid unnecessary CompilableProvier castings (#84) * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlUserFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlCustomFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * make VisitNullable() private * ToArray(t.tables.Length) for consistency * SqlServer: Both US English and British English are considered english * Improve changelog * Fix build * Change version to next developing * Add changelog file * After merge changes - TestHelper.AddValueRow() is for all build targets - SqlSessionHandler: shared code for async and sync Execute + renames - TemporaryTableManager: removed unused code - CommandFactory: removed commented code - DomainConfuguration: fixed bug of MaxNumberOfConditions value not being validated (added tests to make sure that validation happens) - Test for temp table popupation - Updated MaxQueryParameterCount for Oracle and PostgreSQL 9.0+ * Add new storage configurations + enrich supported databases list * Fixed bad merge results * Remove usage of obsolete SqlInsert.Values from object cloning * Changelog improved * Update Orm/Xtensive.Orm/Sql/Internals/SqlNodeCloneContext.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Fix SqlTruncateTable.Clone() * Fix build * Refactor SqlInsert.Clone() * Changelog improved * Return CompilableProvider from Visitors * Proposes changes on top of DataObjects-NET#274 (#134) * Make CompilableProviderVisitor API declaration for provider vistitors - ProviderVisitor no longer parent type for any other type and [Obsolete] - ProviderVisitor changes reverted - CompilableProviderVisitor gets protected Visit method from ProviderVisitor and all the summaries coppied; also changes signature of expressionTranslator to not allow having Provider as incoming parameter and cause issies. * Apply covariant returns to CompilableProviderVisitor descendants * CompilableProviderVisitor: convert IFs to conditionals * Revert obsolescence of ProviderVisitor --------- Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net>
SergeiPavlov
added a commit
that referenced
this pull request
Jul 27, 2023
* Use C#9 Covariant return types feature for Clone() implementation for more type safety * Make SqlNodeCloneContext readonly struct * Continue refactoring * Refactor other Clone() * Get rid of IsNullReference() in modified lines * Small optimizations (#74) * Optimize VisitMethodCall() * Optimize Provider constructor * Use Array.Empty<T>() instead of allocating Empty array * Get rid of unused PriorityQueue<> class * VisitNullable() * Avoid unnecessary CompilableProvier castings (#84) * Fix hinding exception & StackTrace in OpenSessionInternalAsync() * Flatten AggregateException with single inner exception * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlUserFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlCustomFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * make VisitNullable() private * ToArray(t.tables.Length) for consistency * SqlServer: Both US English and British English are considered english * Improve changelog * Fix build * Change version to next developing * Add changelog file * After merge changes - TestHelper.AddValueRow() is for all build targets - SqlSessionHandler: shared code for async and sync Execute + renames - TemporaryTableManager: removed unused code - CommandFactory: removed commented code - DomainConfuguration: fixed bug of MaxNumberOfConditions value not being validated (added tests to make sure that validation happens) - Test for temp table popupation - Updated MaxQueryParameterCount for Oracle and PostgreSQL 9.0+ * Add new storage configurations + enrich supported databases list * Fixed bad merge results * Remove usage of obsolete SqlInsert.Values from object cloning * Changelog improved * Update Orm/Xtensive.Orm/Sql/Internals/SqlNodeCloneContext.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Fix SqlTruncateTable.Clone() * Fix build * Refactor SqlInsert.Clone() * Changelog improved * Return CompilableProvider from Visitors * Proposes changes on top of DataObjects-NET#274 (#134) * Make CompilableProviderVisitor API declaration for provider vistitors - ProviderVisitor no longer parent type for any other type and [Obsolete] - ProviderVisitor changes reverted - CompilableProviderVisitor gets protected Visit method from ProviderVisitor and all the summaries coppied; also changes signature of expressionTranslator to not allow having Provider as incoming parameter and cause issies. * Apply covariant returns to CompilableProviderVisitor descendants * CompilableProviderVisitor: convert IFs to conditionals * Revert obsolescence of ProviderVisitor * Improve changelog --------- Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net>
SergeiPavlov
added a commit
that referenced
this pull request
Jul 28, 2023
* Use C#9 Covariant return types feature for Clone() implementation for more type safety * Make SqlNodeCloneContext readonly struct * Continue refactoring * Refactor other Clone() * Get rid of IsNullReference() in modified lines * Small optimizations (#74) * Optimize VisitMethodCall() * Optimize Provider constructor * Use Array.Empty<T>() instead of allocating Empty array * Get rid of unused PriorityQueue<> class * VisitNullable() * Avoid unnecessary CompilableProvier castings (#84) * Avoid unnecessary CompilableProvier castings (#84) * Refactor ProviderVisitor to avoid code duplication (#86) * Fix hinding exception & StackTrace in OpenSessionInternalAsync() * Flatten AggregateException with single inner exception * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlUserFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlCustomFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * make VisitNullable() private * ToArray(t.tables.Length) for consistency * SqlServer: Both US English and British English are considered english * Improve changelog * Fix build * Change version to next developing * Add changelog file * After merge changes - TestHelper.AddValueRow() is for all build targets - SqlSessionHandler: shared code for async and sync Execute + renames - TemporaryTableManager: removed unused code - CommandFactory: removed commented code - DomainConfuguration: fixed bug of MaxNumberOfConditions value not being validated (added tests to make sure that validation happens) - Test for temp table popupation - Updated MaxQueryParameterCount for Oracle and PostgreSQL 9.0+ * Add new storage configurations + enrich supported databases list * Fixed bad merge results * Remove usage of obsolete SqlInsert.Values from object cloning * Changelog improved * Update Orm/Xtensive.Orm/Sql/Internals/SqlNodeCloneContext.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Fix SqlTruncateTable.Clone() * Fix build * Refactor SqlInsert.Clone() * Changelog improved * Return CompilableProvider from Visitors * Proposes changes on top of DataObjects-NET#274 (#134) * Make CompilableProviderVisitor API declaration for provider vistitors - ProviderVisitor no longer parent type for any other type and [Obsolete] - ProviderVisitor changes reverted - CompilableProviderVisitor gets protected Visit method from ProviderVisitor and all the summaries coppied; also changes signature of expressionTranslator to not allow having Provider as incoming parameter and cause issies. * Apply covariant returns to CompilableProviderVisitor descendants * CompilableProviderVisitor: convert IFs to conditionals * Revert obsolescence of ProviderVisitor * Improve changelog * After-merge fix * Prevent continuation happening if parent task was canceled otherwise OperationCanceledException will be swallowed --------- Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net>
This file contains hidden or 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
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.
Optimizations:
if (node.Expression is not null) Visit(node.Expression);->VisitNullable(node.Expression);to avoid double property dereferencenew T[0]->Array.Empty<T>();method.Nameproperty dereferenceAlso:
PriorityQueue<>- it is standard class in .NET6