Skip to content

Use frozen collections where suitable#24373

Merged
maliming merged 4 commits intoabpframework:devfrom
MarkCiliaVincenti:Frozen
Dec 31, 2025
Merged

Use frozen collections where suitable#24373
maliming merged 4 commits intoabpframework:devfrom
MarkCiliaVincenti:Frozen

Conversation

@MarkCiliaVincenti
Copy link
Contributor

Improves performance. Also made some code cleaning changes.

@maliming maliming requested a review from Copilot December 9, 2025 05:05
@maliming maliming added this to the 10.1-preview milestone Dec 9, 2025
@maliming maliming self-requested a review December 9, 2025 05:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request introduces performance improvements by replacing mutable collections with frozen collections (FrozenDictionary<TKey, TValue> and FrozenSet<T>) for read-only data structures that are initialized once and never modified. The PR also includes code modernization changes using collection expression syntax ([]) for empty collections and fixes several code quality issues.

Key changes:

  • Conversion of static/readonly Dictionary and HashSet collections to FrozenDictionary and FrozenSet for better runtime performance
  • Modernization of empty collection initialization using collection expression syntax ([])
  • Code quality fixes including typo corrections (_onfigurations → _configurations), removal of double semicolons, cleanup of unused imports, and formatting improvements

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
modules/docs/app/VoloDocs.Web/Pages/Error.cshtml.cs Converted error messages dictionary to FrozenDictionary
framework/test/Volo.Abp.MultiLingualObjects.Tests/Volo/Abp/MultiLingualObjects/MultiLingualObjectManager_Tests.cs Converted test translations to FrozenDictionary
framework/src/Volo.Abp.Specifications/Volo/Abp/Specifications/ParameterRebinder.cs Updated empty dictionary initialization to use collection expression
framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/MongoModelBuilder.cs Simplified object initialization syntax
framework/src/Volo.Abp.MemoryDb/Volo/Abp/Domain/Repositories/MemoryDb/MemoryDatabaseCollection.cs Updated empty dictionary initialization to use collection expression
framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationResourceDictionary.cs Updated empty dictionary initialization to use collection expression
framework/src/Volo.Abp.Http/Volo/Abp/Http/ProxyScripting/Generators/ProxyScriptingJsFuncHelper.cs Converted reserved words collection to FrozenSet
framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/PostConfigureAbpRabbitMqEventBusOptions.cs Converted queue argument collections to FrozenSet
framework/src/Volo.Abp.Core/Volo/Abp/Reflection/TypeHelper.cs Converted type collections to FrozenSet
framework/src/Volo.Abp.Core/Volo/Abp/Logging/DefaultInitLoggerFactory.cs Updated to use collection expression and removed double semicolon
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs Removed unused imports and updated collection initialization
framework/src/Volo.Abp.BlazoriseUI/BlazoriseUiObjectExtensionPropertyInfoExtensions.cs Converted type collections to FrozenSet
framework/src/Volo.Abp.BackgroundWorkers.TickerQ/Volo/Abp/BackgroundWorkers/TickerQ/AbpBackgroundWorkersTickerQOptions.cs Fixed typo in field name (_onfigurations → _configurations)
framework/src/Volo.Abp.AspNetCore.Mvc.UI/Volo/Abp/ObjectExtending/MvcUiObjectExtensionPropertyInfoExtensions.cs Converted number types collection to FrozenSet
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs Converted input types dictionary to FrozenDictionary and improved code formatting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@maliming maliming modified the milestones: 10.1-preview, 10.2-preview Dec 29, 2025
@maliming maliming merged commit c9a4ab4 into abpframework:dev Dec 31, 2025
2 checks passed
@maliming
Copy link
Member

Thank you for your contribution. 👍

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.

3 participants