From: Markus S. <mar...@gm...> - 2016-02-07 06:19:28
|
When you cache an object, you should not modify it. So don't get-modify-use-reset-putback. You should also not fetch a collator for each string comparison, neither from scratch nor from a cache. You should at least reuse it for a whole larger operation, for example sorting a list of strings. Getting one each time may or may not be fast enough then. If you do need to cache, then you could either cache with options (potentially big cache), or cache without options, clone the cached collator, modify, use, and delete the clone. Cloning a collator should be fast. Best regards, markus |