2007-12-11 [長年日記]

[C++] Comparison of Strings Implementations in C++ language

前回のレポートの更新です。例によって結論だけ引用すると、

  • for processing long strings (greater than 10K) the best choice is ropes;
  • if you use strings with sizes 0.5KK–10K then strings implementation from GNU libstdc++ is a good choice; this will be good too if you only pass strings as parameters, without modifications (but this is bad programming technique nevertheless);
  • if you general work is modification of strings with sizes less then 0.5K, the strings from STLport are for you;
  • the time of advantage of node_alloc in STLport is in the past; progress in allocation algorithms in core system eliminate positive effect of node_alloc in single-threaded applications and demonstrate significant advantage of core system allocators in multi-threaded applications;
  • string proxy object (aka expression template) technique is very useful.

ということです。基本的な結論は前回と変わっていませんが、

  • node_allocは過去の遺物(マルチスレッドではむしろ遅い)
  • expression templateを使った文字列連結の実装は効果的

という辺りが追加されています。msvcr80.dllのアロケータとnode_allocの比較も欲しい所です。


トップ «前の日記(2007-12-10) 最新 次の日記(2007-12-12)»