-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Optimize ElasticIndexingService #15227
Conversation
Yes, it is. |
src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Recipes/ElasticIndexRebuildStep.cs
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Recipes/ElasticIndexResetStep.cs
Show resolved
Hide resolved
...OrchardCore/OrchardCore.Search.Elasticsearch.Core/Services/ElasticIndexInitializerService.cs
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Services/ElasticIndexingService.cs
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Services/ElasticIndexingService.cs
Outdated
Show resolved
Hide resolved
.ToList(); | ||
} | ||
|
||
if (indexSettingsList.Count == 0) |
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.
Avoid Any when possible :)
src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Services/ElasticIndexingService.cs
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Services/ElasticIndexingService.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Services/ElasticIndexingService.cs
Outdated
Show resolved
Hide resolved
@Skrypt I did a benchmark to iterate over 1000 integers. Result summery is speed vs allocation! Using List is faster but comes at the cost of allocation more as you expected. I'll modify the code to no use the list. |
This pull request has merge conflicts. Please resolve those before requesting a review. |
src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Services/ElasticIndexingService.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Services/ElasticIndexingService.cs
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Search.Elasticsearch.Core/Services/ElasticIndexingService.cs
Show resolved
Hide resolved
@Skrypt are you good with this PR? |
@Skrypt perhaps this is a more interesting PR that the other one?