Reduce overheads of EventSource.WriteEvent(int, object[]) with ETW (#54925)
authorStephen Toub <stoub@microsoft.com>
Thu, 1 Jul 2021 10:43:44 +0000 (06:43 -0400)
committerGitHub <noreply@github.com>
Thu, 1 Jul 2021 10:43:44 +0000 (06:43 -0400)
commit03cafd76bc1b048b4bb93e90f40cbae8ee30a815
treee410f7eec1b7de0947a8b2a11aba5abfa7ed8dcf
parent6dd08fb8121d6db1ecab0b4df96783bbf64fc129
Reduce overheads of EventSource.WriteEvent(int, object[]) with ETW (#54925)

* Reduce overheads of EventSource.WriteEvent(int, object[]) with ETW

Cuts allocation by ~3-4x on basic use cases by avoiding a `List<int>(8)` and `List<object>(8)` allocation along with the underlying arrays.

* Fix standalone build

* Address PR feedback
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventProvider.cs