You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Well, I'm not sure any item in this list can be used actually 😢
CompositeFormat: ZeroLog doesn't use composite formatting APIs
Enum intrinsics: these methods aren't used in a hot path
Frozen collections: we don't use read-only collections, so no opportunity to use those
Unsafe.BitCast: could be useful in one place, but not in a hot path
IUtf8SpanFormattable, Utf8.TryWrite: that's the real good stuff - I wrote a POC in the utf8 branch which formats directly to UTF-8 bytes, but unfortunately that doesn't seem to improve the perf. Given that it duplicates a lot of code I don't think it's worth the effort to maintain.
TimeProvider: that's not perf-related but could be a useful new feature (there's even a TODO for this)
[ConstantExpected]: I didn't find good uses for this in ZeroLog
Interceptors: they're still experimental but could be interesting later
Profiling shows we spend a lot of time formatting DateTime and TimeSpan values, so maybe we could try to improve those first. Given that we use custom format strings the performance is hindered as those are parsed for each logged message. Maybe we should provide our own formatters, like in ZeroLog v1?
Here's a list of things to look at once we add a net8.0 target:
CompositeFormat
class. I don't think we need it since it doesn't parse the format strings eagerly (at least ATM).Type.IsEnum
andType.GetEnumUnderlyingType
are now intrinsics:Make Type.IsEnum and Type.GetEnumUnderlyingType intrinsics dotnet/runtime#71685
FrozenDictionary
/FrozenSet
Unsafe.BitCast
: Adding System.Runtime.CompilerServices.Unsafe.BitCast dotnet/runtime#82917IUtf8SpanFormattable
,Utf8.TryWrite
,Encoding.TryGetBytes
TimeProvider
instead of hard-coded clock: API to provide the current system time dotnet/runtime#36617[ConstantExpected]
on parametersNew C#/Roslyn features:
This list will be updated with each blog post about .NET 8 🙂
The text was updated successfully, but these errors were encountered: