[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: QT_NO_STL in KDE4
From:       Marc Mutz <mutz () kde ! org>
Date:       2006-09-14 7:49:37
Message-ID: 200609140949.38510.mutz () kde ! org
[Download RAW message or body]

On Wednesday 13 September 2006 12:59, Dirk Mueller wrote:
> > > Because kde3 did - that's the only reason so far.
> >
> >   So we no longer care that it noticeably increases build times or it
> > doesn't do so anymore?
>
> We care about performance? Huh? Since when?
>
> Just my own small little benchmark:
>
> $ make -j30 kdelibs r583758:
> real      9m2.265s
> user      7m58.346s
> sys       3m48.798s
>
> $ make -j30 kdelibs r583758 -DQT_NO_STL:
> real      6m16.271s
> user      5m53.586s
> sys       2m49.827s
>
>
> But anyway, building time is unimportant.

Last sentence seconded. Running time is, though. "Just my little benchmark"...

On Wednesday 15 February 2006 21:49, I wrote:
> As a comparison (note that I run this in valgrind to
> slow it down, so the setup and teardown times benefit slot
> implementations): QLinkedList<int>: 11.030
> QList<int>: 3.830
> QVector<int>: 3.060
> std::vector<int>: 2.040
> std::deque<int>: 1.540
> std::list<int>: 10.870
>
> QLinkedList<double>: 11.410
> QList<double>: 12.520
> QVector<double>: 4.790
> std::vector<double>: 2.630
> std::deque<double>: 2.170
> std::list<double>: 10.860
>
> QLinkedList<QString>: 11.220
> QList<QString>: 3.820
> QVector<QString>: 3.300
> std::vector<QString>: 2.190
> std::deque<QString>: 1.630
> std::list<QString>: 11.140
>
>
> So much for fast Qt Containers...

And about:

On Wednesday 13 September 2006 17:35, Dirk Mueller wrote:
> I've yet to see a single real world application that uses it properly.

I guess we can arrange for you to sign an NDA with some of our clients to be 
able to see the code that can be produced when there are no personal quests 
against using anything with "standard" and "C++" in the same sentence, 
however understandable these are for historical reasons.

If that's not possible, boost.org as well as opensource.adobe.com contains 
material that can be called both "real-world" and "using STL properly".

Cheers,
Marc

["test.cpp" (text/x-c++src)]

#include <QtCore>

#include <vector>
#include <deque>
#include <list>

template<int N>
struct Large {
    char data[N];
};

template <typename C>
void memleaker( const int num ) {
    C * list = new C();
#ifdef MEML_RSRV
    list->reserve( num );
#endif
    const typename C::value_type proto = typename C::value_type();
    for ( int i = 0 ; i < num ; ++i )
        list->push_back( proto );
}

int main( int, char ** ) {
    memleaker< MEML_TYPE >( 1024 * 1024 );
    return 0;
}



["benchmark.sh" (application/x-shellscript)]

#!/bin/bash

TIMEFORMAT='%3U'
for simple in char short int double QString QByteArray \
    Large\\\<{12,16,20,24,32}\\\>; do
  for cont in Q{Linked,}List QVector std::{vector,deque,list}; do
      make clean >/dev/null 2>&1
      qmake "CONFIG+=release" "DEFINES+=MEML_TYPE=$cont\<$simple\>"
      make >/dev/null 2>/dev/null || echo failed at $cont $simple
      echo -n "$cont<$simple>: "
      time ( valgrind ./foo >/dev/null 2>/dev/null )
  done
done


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic