Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Bo Persson Newsgroups: comp.lang.c++ Subject: Re: C++ may sometimes be *too* simple (to use) Date: Fri, 30 Apr 2021 15:33:55 +0200 Lines: 34 Message-ID: References: <85cd53e7-a0c5-435b-9d6a-586e628c0934n@googlegroups.com> <174354a1-ab2e-4fea-95bb-14dda18f37d6n@googlegroups.com> <3d6f3bcc-63a8-4498-9600-69a3c6b5088cn@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net veANTJOSARWppwcFClMC2wUMW9uQMihLSPqb3ETG479ZNupgtE Cancel-Lock: sha1:KaVnZtNRX18tENOWLCUexvOfd64= User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 In-Reply-To: Content-Language: sv Xref: csiph.com comp.lang.c++:79370 On 2021-04-30 at 12:10, Juha Nieminen wrote: > ?? Tiib wrote: >> Because that bottleneck does not exist. All that time wasted and 1% >> of performance gained. Meanwhile possible opportunities to improve >> performance several times lost. > > If an action that could take a hundreth of a second is instead > taking a second, there certainly is a bottleneck. It's not a bottleneck if that program runs 3 times a day. At non peak hours. > > The problem is that if the bottleneck is distributed among > thousands of sloppily written lines, each with an attitude of > "this doesn't need to be efficient", you aren't going to fix > that bottleneck any time soon. > >>> I think that *deliberately* writing inefficient code is highly >>> counterproductive. >> >> I don't think someone deliberately wrote c.size()==0 when it was less >> efficient than c.empty() ... or it++ when ++it was more efficient. Their >> focus was simply on things that mattered. > > When the attitude is "this doesn't need to be efficient", and > "it doesn't matter if this takes 10 times longer because the > time is still in the microseconds", then you *are* deliberately > and willingly writing inefficient code. > It is often more efficient use of the developer's time to focus on the applications that has the most runtime on a specific system - perhaps using several CPU-hours per day. Not trying to get everything else down from 5 to 4 microseconds.