Files
swift-nio-imap/Sources/NIOIMAPCore/Parser
David Evans 81718846da Implement a string parsing cache (#672)
Resolves #669

Maintaining many versions of the same string can be expensive for strings over a given size (10 bytes), where they become heap-allocated. For example, in IMAP there may be many thousands of messages with the same flags (e.g. deleted, seen, replied).

Here we introduce a user-controllable cache that allows the user to provide a single instances of some strings if they require. Whenever we parse an atom (i.e. a string), that string is passed to the cache (which defaults to just returning the string), which may then return a cached version.
2022-01-10 14:52:33 +00:00
..
2020-10-26 09:54:46 +00:00