-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Reduce substring allocations #189
Reduce substring allocations #189
Conversation
* Alignment operator inheritance is optimized * DictionarySource performance improved
Codecov Report
@@ Coverage Diff @@
## version/v3.0 #189 +/- ##
===========================================
- Coverage 95% 95% -0%
===========================================
Files 49 50 +1
Lines 2019 2050 +31
===========================================
+ Hits 1910 1939 +29
- Misses 109 111 +2
Continue to review full report at Codecov.
|
#### Target frameworks * Changed `netstandard2.0` to `netstandard2.1`. * `net461` support unchanged. * Added package `System.Memory` #### Remove repetitive substring allocations Connected modifications: * Added method `Write(ReadOnlySpan<char> text)` to `IFormattingInfo` * Generated substrings are cached in classes `Format`, `FormatItem`, `LiteralText`, `Placeholder` and `Selector`. * Evaluating escaped characters for `Placeholder.FormatterOptions` and `LiteralText` work without heap memory allocation. #### Alignment operator inheritance is optimized * Alignment implementation introduced with PR [axuno#174](axuno#174) is modified for better performance * Added method `Placeholder.AddSelector` * `Placeholder.Selectors` is now internal. Selectors are accessible with `IReadOnlyList<Selector> Placeholder.GetSelectors()`. #### DictionarySource performance improved * Implemented suggestion in issue [axuno#186](axuno#186) for better speed and less GC pressure. * Side effect: We're using the `CaseSensitivityType` of the dictionary for getting the value for a key. `Settings.GetCaseSensitivityComparison()` will not be applied.
Target frameworks
netstandard2.0
tonetstandard2.1
.net461
support unchanged.System.Memory
Remove repetitive substring allocations
Connected modifications:
Write(ReadOnlySpan<char> text)
toIFormattingInfo
Format
,FormatItem
,LiteralText
,Placeholder
andSelector
.Placeholder.FormatterOptions
andLiteralText
work without heap memory allocation.Alignment operator inheritance is optimized
Placeholder.AddSelector
Placeholder.Selectors
is now internal. Selectors are accessible withIReadOnlyList<Selector> Placeholder.GetSelectors()
.DictionarySource performance improved
CaseSensitivityType
of the dictionary for getting the value for a key.Settings.GetCaseSensitivityComparison()
will not be applied.