Date: Wed, 20 Jan 1999 11:16:33 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Dong-Yueh Liu cc: djgpp AT delorie DOT com Subject: Re: Question about efficiency: vector vs. deque In-Reply-To: <36a5846a.17595250@news.silkera.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Wed, 20 Jan 1999, Dong-Yueh Liu wrote: > The program is compile with -O3 option to turns on optimizations. In many cases, -O2 is better than -O3. > I am amazed by the result since I expected that vector should be > faster the deque, but the result is reverse. The following is that > I use VC++ 6.0 to compile the same program: > vector: 0.961 seconds > deque: 4.446 seconds > > Can anyone explain why the efficiency of vector is worse than > deque using gcc2.81? ``Use the source, Luke!'' The sources of the implementation of vector used by DJGPP are free to browse and hack (get v2gnu/lgp2811s.zip). I think some implementations of vector reallocate memory very often, which might explain the difference. But that's a speculation.