intelligentplant / AppStoreConnect.Adapters

Allows Intelligent Plant App Store Connect to query 3rd party systems
https://appstore.intelligentplant.com
MIT License
0 stars 0 forks source link

Add custom string cache #403

Closed wazzamatazz closed 3 weeks ago

wazzamatazz commented 3 weeks ago

This PR adds a static StringCache class that can be used to intern frequently-used strings to reduce memory usage.

StringCache is based on a concept described here that demonstrates that alternatives to string.Intern can perform a similar function but with much better performance. The PR also adds extension methods to make it easy to add or retrieve interned strings e.g. return "Some string".InternToStringCache();.