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 31,579 of 33,346   
   Vyacheslav Lanovets to gast128@hotmail.com   
   Re: Performance difference between std::   
   21 Oct 11 05:16:35   
   
   3d902245   
   From: xentrax@lanovets.ru   
      
   Hello!   
      
   On 20.10.2011 21:56, gast128@hotmail.com wrote:   
   > Hello all   
   >   
   > we use here Visual Studio 2010 and notice quite an impressive   
   > performance difference between the boost and std unordered_map: about   
   > a factor 10 in favor of the boost implementation. Is there something   
   > specified in the std which makes them slower?   
      
   boost::unordered_map uses much simpler hash function for integers (just   
   integer value itself).   
      
   I've got about 1.5x difference instead of 6x after I used same hash as   
   in boost.   
      
   struct myhash : public std::unary_function   
   {   
   	size_t operator()(const int a) const   
   	{   
   		return a;   
   	}   
   };   
   std::unordered_map     stlmap1;   
      
      
   And it's interesting to know if VS2010's hash implementation can ever be   
   more useful for unordered map.   
      
   Regards,   
   Vyacheslav   
      
      
   --   
         [ 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