This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Performance of the default node allocator.
- From: "Alex Vinokur" <alexvn at connect dot to>
- To: libstdc++ at gcc dot gnu dot org
- Date: Thu, 13 Nov 2003 10:59:16 +0200
- Subject: Re: Performance of the default node allocator.
- References: <mailman.65367.1068226008.1684.gnu-libstdcpp@lists.nsr.labs.mot.com> <200311110628.hAB6SL6c004734@latour.rsch.comm.mot.com>
"Loren James Rittle" <rittle@latour.rsch.comm.mot.com> wrote in message 200311110628.hAB6SL6c004734@latour.rsch.comm.mot.com">news:200311110628.hAB6SL6c004734@latour.rsch.comm.mot.com...
[snip]
Hi Loren,
I have several questions and some suggestions.
> #include <iostream>
> #include <algorithm>
> #include <list>
#include <vector>
> #include <memory>
--------------------------------------------
> #include <testsuite_performance.h>
Does GNU gcc contain such testsuite_performance.h?
--------------------------------------------
>
> template <class T>
> void clear_container (T& _cont) { T temp; std::swap (temp, _cont); }
>
vector<double> vect;
> int main ()
> {
> std::list <double> il;
------------------------------------
> using namespace __gnu_test;
Can users (not only developers) use that namespace?
I didn't find __gnu_test in g++ 3.3.1 (cygming special).
------------------------------------
> time_counter time;
> resource_counter resource;
>
> for (int x = 3; x--;)
> {
> srand(0);
vect.clear();
for (int i = 0; i < SIZE; ++i) vect.push_back(rand()%300);
> start_counters(time, resource);
--------- Remove? ---------
> for (int i = 0; i < 700000; ++i)
> il.push_back(rand()%300);
--------------------------
for (int i = 0; i < 700000; ++i) push_back(vect[i])
> stop_counters(time, resource);
> report_performance(__FILE__, "insert", time, resource);
>
> start_counters(time, resource);
> il.sort();
> stop_counters(time, resource);
> report_performance(__FILE__, "sort", time, resource);
>
> start_counters(time, resource);
> clear_container(il);
> stop_counters(time, resource);
> report_performance(__FILE__, "clear", time, resource);
> }
> }
>
--
=====================================
Alex Vinokur
mailto:alexvn@connect.to
http://mathforum.org/library/view/10978.html
news://news.gmane.org/gmane.comp.lang.c++.perfometer
=====================================