Skip to content
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

Improvements for .NET 8 #62

Closed
ltrzesniewski opened this issue Feb 22, 2023 · 1 comment
Closed

Improvements for .NET 8 #62

ltrzesniewski opened this issue Feb 22, 2023 · 1 comment

Comments

@ltrzesniewski
Copy link
Member

ltrzesniewski commented Feb 22, 2023

Here's a list of things to look at once we add a net8.0 target:

New C#/Roslyn features:

This list will be updated with each blog post about .NET 8 🙂

@ltrzesniewski
Copy link
Member Author

ltrzesniewski commented Dec 11, 2023

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?

@ltrzesniewski ltrzesniewski closed this as not planned Won't fix, can't repro, duplicate, stale Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant