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,043 of 33,346   
   Martin B. to Seungbeom Kim   
   Re: std::tr1::array performance   
   23 Mar 12 22:33:23   
   
   From: 0xCDCDCDCD@gmx.at   
      
   On 23.03.2012 06:05, Seungbeom Kim wrote:   
   > I have a project where I have a std::vector  member in a struct.   
   > The size N is small (around 3) and fixed, so I don't need it to grow   
   > anyway, while it still incurs dynamic allocation for every such object,   
   > so I decided to replace it.   
   >   
   > The obvious options are bool[N] and std::tr1::array.   
   > The latter supports more convenient assignment and initialization,   
   > while for the former I have to write helper functions, so the latter   
   > seemed like a (slightly) better choice.   
   >   
   > However, when I measured the performances, I found that the program with   
   > std::tr1::array  took about 2% (i.e. about a minute) longer than   
   > the one with bool[N]. I don't have a lot of samples yet,   
      
   Maybe my (Windows, VC++) experiences aren't representative, but 2 (two)   
   percent and "don't have a lot of samples yet" ???   
      
   Measuring performance differences of 2% should always require a   
   *massive* amount of samples to be reliable. Especially since your   
   program seems to run for 50 (fifty) minues ( 2 x 50 = 100 % = minutes),   
   there are quite a lot of error sources for performance measurement   
   during a run of 50 minutes, even if the machine is doing "nothing" else.   
      
   cheers,   
   Martin   
      
   --   
   Good C++ code is better than good C code, but   
   bad C++ can be much, much worse than bad C code.   
      
      
         [ 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