Skip to content

Small optimizations (#74)#265

Merged
alex-kulakov merged 2 commits intoDataObjects-NET:masterfrom
servicetitan:upstream/optimizations
Jul 18, 2023
Merged

Small optimizations (#74)#265
alex-kulakov merged 2 commits intoDataObjects-NET:masterfrom
servicetitan:upstream/optimizations

Conversation

@SergeiPavlov
Copy link
Copy Markdown
Contributor

  • Optimize VisitMethodCall()

  • Optimize Provider constructor

  • Use Array.Empty() instead of allocating Empty array

  • Get rid of unused PriorityQueue<> class

  • VisitNullable()

* Optimize VisitMethodCall()

* Optimize Provider constructor

* Use Array.Empty<T>() instead of allocating Empty array

* Get rid of unused PriorityQueue<> class

* VisitNullable()
@alex-kulakov
Copy link
Copy Markdown
Contributor

alex-kulakov commented Dec 27, 2022

Get rid of unused PriorityQueue<> class

No public classes deletions allowed, make it [Obsolete]. Removing the test for this collection is OK, though.

Comment thread Orm/Xtensive.Orm/Orm/Providers/SqlSelectProcessor.cs Outdated
/// <param name="type">The type of the provider.</param>
/// <param name="sources"><see cref="Sources"/> property value.</param>
protected Provider(ProviderType type, params Provider[] sources)
protected Provider(ProviderType type, IReadOnlyList<Provider> sources)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain what was the problem here? Native array is better, isn't it?
Was it for safety reasons so user code wouldn't be able to change items?

This is a breaking change which generates a breaking change of the ExecutableProvider ctor, so I need to evaluate its pros.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only reason: make Provider.Sources readonly collection

@SergeiPavlov
Copy link
Copy Markdown
Contributor Author

Get rid of unused PriorityQueue<> class

No public classes deletions allowed, make it [Obsolete]. Removing the test for this collection is OK, though.

PrioriyQueue is standard class in .NET6+
https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.priorityqueue-2?view=net-7.0

@alex-kulakov alex-kulakov merged commit ade1767 into DataObjects-NET:master Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants