home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 32,955 of 33,346   
   James K. Lowden to alan_mckenney1@this.is.invalid   
   Re: Sequence container capacity after ca   
   29 Mar 13 13:30:52   
   
   From: jklowden@speakeasy.net   
      
   On Thu, 28 Mar 2013 15:17:29 -0700 (PDT)   
   alan_mckenney1@this.is.invalid wrote:   
      
   > > Are you saying vector::operator[] takes 30% more time than a bare   
   > > pointer?  Or that your program's *overall* performance is 30% faster   
   > > if you use C arrays instead of std::vector?  Or something else?   
   >   
   >    Minimizing the frequency of heap allocation and deallocation can   
   >    gain us at least 30%, so I won't use std::vector as a local   
   >    variable in the processing phase, because that would mean that each   
   >    function call results in an allocation and deallocation.   
      
   I see.  That's an astonishing figure.  You really should publish   
   what you've learned.   
      
   > > If so, isn't pushing on the efficiency pedal a losing battle?   
   > > By squeezing 30%, you don't *avoid* buying the next machine; at   
   > > best you just defer it.  By how long, do you reckon?   
   >   
   >    By that logic, there's no point to going to the doctor when you're   
   > sick, either, since you're only putting off the inevitable.   
      
   Time in incompressible and money is fungible.  You can spend your time   
   on efficiency gains or functionality, seldom both at once.  You're   
   asserting that the loss in productivity is economically justified.  All   
   I'm asking is for you to describe that environment, if you would,   
   because I've never heard of anything like it, except in the embedded   
   space.   
      
   --jkl   
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca