ical.net
ical.net copied to clipboard
Optimize `IStringSerializer.SerializeToString` for less GC pressure
Exploring current implementation of ComponentSerializer.SerializeToString and it's siblings in other serialization classes I noticed, that instead of drilling down to callers StringBuilder children always create their owns.
I suggest to have some way to use common (single) StringBuilder all way down in the serialization.
This can reduce memory pressure and allocation of objects that are essentially unnecessary.
It also opens a way to customization of calendar objects and their serialization for granular calendar building that could pay attention to some external caching strategy of, say, events and others.