[ROOT] execution speed of compiled programs using ROOT

From: Thomas Nisius (tnisius@web.de)
Date: Fri Aug 08 2003 - 14:28:22 MEST


Hi,

when I compile a program that include some root objects, execution speed drops significantly.
please see the following example:

#include <time.h>
#include <iostream>
using namespace std;

#include <TH2D.h>
#define USE_ROOT

int main(int argc, char* argv[]) {

#ifdef USE_ROOT
  TH2D *h = new TH2D("test","test",64,0,1,64,0,1);
  h->FillRandom("gaus",1000);
#endif

  double r=0;
  double time = clock(); // save the clock
  for(long int i=0; i<100000000; i++) {
    r += 0.5;
  }
  cout << r << endl;
  cout << "Duration: " << clock() - time << endl;
  return 0;
}

if in this example 'USE_ROOT' is defined the duration is nearly twice as long as without it.
(note, that only the execution of the loop is taken into account, not the histo filling)

I'm using Root 3.05/07 (win32gdk-version) on WinXP & Win2000 
Compiler: MSVC++ 6
I link libCore.lib and libHist.lib to my Project

Any suggestions?

Kind Regards
Thomas Nisius
__________________________________________________________________________
Die sicherste Form der Kommunikation: E-Mails verschluesseln, Spam-Filter,
Adressverifizierung, digitale Unterschrift: http://freemail.web.de



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:14 MET