Closed IcanBENCHurCAT closed 2 years ago
@nblumhardt mind taking a look at this?
Hi @IcanBENCHurCAT - would overriding WriteDictionary()
be simpler and require fewer allocations?
https://github.com/serilog/serilog/blob/dev/src/Serilog/Formatting/Json/JsonFormatter.cs#L329
Yes, I like that approach much better. I'll update and let you know.
@nblumhardt I think I've done a better job with this commit. It definitely seems more readable, but I couldn't see much that I could cut down on allocations.
This code works well in our main package, executes without error and I cannot notice any kind of performance differences.
@IcanBENCHurCAT Do you feel this PR is still needed with direct BSON support in the latest version?
The previous fix would work if the offending characters were in the key of the element to be written. When that element contains dictionaries, those keys need to be parsed as well (recursively)