Performance of the default node allocator.
Alex Vinokur
alexvn@connect.to
Thu Nov 13 08:59:00 GMT 2003
"Loren James Rittle" <rittle@latour.rsch.comm.mot.com> wrote in message 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
=====================================
More information about the Libstdc++
mailing list