|
From: Stephen W. <st...@ic...> - 2009-11-27 16:05:31
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Cheng wrote: > Hi Cary, > > I see. > > Besides, I have long noticed that you use your own perm_string > class instead of C++ String class to manage strings. Is it because > C++ String consumes lots of memory? > > > Bruce The reason for that is to save memory. In particular, it saves allocation overhead. When you are creating tons of short strings that you never intend to release, then much memory can be saved by allocating big chunks of memory and farming bytes out to strings tightly packed into that memory. No deallocation is allowed, so no allocation overhead is needed. This made a big difference in memory use when first implemented. - -- Steve Williams "The woods are lovely, dark and deep. steve at icarus.com But I have promises to keep, http://www.icarus.com and lines to code before I sleep, http://www.picturel.com And lines to code before I sleep." -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFLD/i/rPt1Sc2b3ikRAgnLAJ9citnoVUBQQuiIYfwcOakQzh1klQCg2KV1 nAGd1mg83sk9nRKSigovz9Y= =KQ5g -----END PGP SIGNATURE----- |