Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!newsreader4.netcologne.de!news.netcologne.de!newsfeed0.kamp.net!newsfeed.kamp.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Bo Persson Newsgroups: comp.lang.c++ Subject: Re: What practice can get speed improvement in C++? Date: Tue, 4 Aug 2015 20:09:59 +0200 Lines: 26 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net VVwgGFUiC/Ub0fcylYpphQ6WgFVJLxxCPxCfNFmezq52gKLeYj Cancel-Lock: sha1:pjY2xx2pzpvCdS1U5ac42/BwVBQ= User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 In-Reply-To: X-Received-Bytes: 1931 X-Received-Body-CRC: 3641503779 Xref: csiph.com comp.lang.c++:37335 On 2015-08-04 19:15, woodbrian77@gmail.com wrote: > On Tuesday, August 4, 2015 at 3:21:29 AM UTC-5, Juha Nieminen wrote: >> woodbrian77@gmail.com wrote: >>> I think there's a place for std::string, but I use it less >>> than previously. I guess it's back to the future with arrays >>> of char. >> >> How would an array of chars be faster than std::string? Unless you are >> using a static array (or somehow reusing the same allocated array, >> which becomes a bit complicated)? >> > > This is interesting > > http://stackoverflow.com/questions/21946447/how-much-performance-difference-when-using-string-vs-char-array > Yes, like one of the replies notices - using sprintf to build filenames will let you start opening the file 0.12 microseconds earlier. Wanna bet if someone will notice the speedup? Bo Persson