[Bug libstdc++/29037] performance problem with std::string operator=(const std::string& str);

2006-09-12 Thread neundorf at kde dot org
--- Comment #9 from neundorf at kde dot org 2006-09-12 20:51 --- > > Starting to think about weird hacks: > > how about keeping the shared-data during string assignment as it is now > > but additionally keep a pointer to the eventually already allocated buffer > >

[Bug libstdc++/29037] performance problem with std::string operator=(const std::string& str);

2006-09-12 Thread neundorf at kde dot org
--- Comment #7 from neundorf at kde dot org 2006-09-12 20:34 --- ... > "problematic" are string assigns, not += and you are moving the reserve > *after* the assign. Yes, but in the every assign the capacity would still be lost. This would mean the reserve would happen

[Bug libstdc++/29037] performance problem with std::string operator=(const std::string& str);

2006-09-12 Thread neundorf at kde dot org
--- Comment #5 from neundorf at kde dot org 2006-09-12 17:55 --- std::string cacheKey; for (...several files...) { cacheKey=current.FileName; cacheKey.reserve(4*1024); for(std::vector::const_iterator i = this->IncludePath->begin(); i != this->IncludePath-&g

[Bug libstdc++/29037] performance problem with std::string operator=(const std::string& str);

2006-09-12 Thread neundorf at kde dot org
--- Comment #2 from neundorf at kde dot org 2006-09-12 17:04 --- The use case here is as follows: std::string cacheKey; cacheKey.resize(4*1024); for (...several files...) { cacheKey=current.FileName; // <- this is the critical line for(std::vector::const_iterator i = t

[Bug libstdc++/29037] New: performance problem with std::string operator=(const std::string& str);

2006-09-12 Thread neundorf at kde dot org
std::string& str); Product: gcc Version: 4.0.2 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: neundorf at kde dot org h