
On Sat, May 5, 2012 at 7:36 AM, Mr.C64 <c64gio@gmail.com> wrote:
On Sat, May 5, 2012 at 1:26 PM, John Maddock <boost.regex@virgin.net> wrote:
"FYI Boost.Pool isn't designed for or optimised for that usage - it's designed for lots of fixed-sized blocks, as happens in a list (or even a map or a set), it's not really designed for fast performance with variable sized blocks as happens in a string or a vector."
Do you know of any open-source allocator (available in Boost or elsewhere), that can be used to *quickly* allocate instances of std::wstring, using an allocation pattern like the one showed in the following blog post?
Thanks, Mr.C64
This is a pretty simple pattern. You could design your own arena allocator for this. Consider a deque std::vector<wchar_t> where each successive vector is some factor larger than the prior. You can just place '\0' delimited strings in that memory, and return it. At the end, when you no longer need your dictionary strings, just clear() your deque. You could go a little lower level for even better performance, but this should already beat the standard allocator by quite a bit. Brian