Closed Maxim-Kornilov closed 2 years ago
Thanks! Looks very promising. I'll try to find some quality review time ASAP, though time is a little tight at the moment, so apologies in advance if the turnaround is not snappy.
apologies in advance if the turnaround is not snappy
That may have been the understatement of 2020! :-D ... Thanks again for this, Maxim.
I finally did have time to think it through; my main concern with using BindMessageTemplate()
here is that it makes the enumeration order of the event properties important. It's not clear that the order of properties in the enumerated structure will always match the order of property names in the template holes. Some ILogger<T>
optimization techniques hand-code the enumeration of properties in the state object, so this could be broken even if we don't have a failing case in front of us.
I don't think we should proceed in this direction, but thanks again, and please let me know if it sounds like I've missed something.
Best regards, Nick
Performs 40-45% faster and uses 40-50% less memory for repeated messages.
Benchmarks
Link to benchmarks source code
Before
After