ical.net icon indicating copy to clipboard operation
ical.net copied to clipboard

Optimize `IStringSerializer.SerializeToString` for less GC pressure

Open ssratkevich opened this issue 1 year ago • 4 comments

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.

ssratkevich avatar Jan 21 '25 13:01 ssratkevich