Hello Thomas, Could you elaborate what was the in initial cause of your investigation? For example for sure ROOT needs some time to be initialized since it loads dozen the share libraries (DLL's). To get the right answer one should ask the right question. What question you want to be answered. I am really reluctant to go deeper at this point. The program you prepared (with "constant" only loop) is no use to do any solid conclusion. On other hand I am not keen to start the discussion how such kind of the code should look like with no solid reason. -----Original Message----- From: Thomas Nisius [mailto:tnisius@web.de] Sent: Thursday, August 14, 2003 10:14 AM To: roottalk@pcroot.cern.ch Cc: fine@bnl.gov; pcanal@fnal.gov Subject: Re: RE: [ROOT] execution speed of compiled programs using ROOT Hi, for me, it is impossible to reproduce your results. I did the same tests and I always get a slowdown by a factor of 2, when root is used. I observed, that when optimization is to aggressive, any root dependent stuff is optimized 'away'; (i.e. there is no more root code involved) I think in your case, Valeri, this explains the same duration for both versions. (with & without root) [Valeri Fine] It is not possible ( optimized "away" ), just change the system.rootrc (see below) to see why? Find and edit there two lines: Root.ShowPath: true Root.Debug: 3 and start your example again. Do you have any other code that can be used to do further tests? [Valeri Fine] Again what do you want to be tested ? I understand introducing some non-trivial code changes significantly the "trivial" program . By the way, I also get this slowdown if I link the root libraries explicitly to my prog. even if there is no call to any root-routine. Any suggestions? [Valeri Fine] Suggestion to what? What is YOUR problem that you want to be solved / explained. Can you reproduce it with other ROOT version? I can image the clock() simply doesn't report the time properly for the multi-thread applications (like ROOT) But first of all to discuss things we need one and the same ROOT env. (By the way I compiled the code with VC6++). Can you install root from http://root.bnl.gov <http://root.bnl.gov/> . It is a single click installation. However one should clean the hand-installed ROOT env( PATH, ROOTSYS variables ) first if any. My best regards, Valeri Thanks in advance, Thomas Nisius > > Hello I made the simple experiments > > 1. Compile the code in ! question with Optimization > 1.1. #define USE_ROOT > 1.2. #undef USE_ROOT > > 2. Compile the code in question with NO Optimization > 2.1. #define USE_ROOT > 2.2. #undef USE_ROOT > > 3. Change the loop as follows: > for(long int i=0; i<100000000; i++) { > r += 0.5; > y = sin(r); > } > Compile the code in question with NO Optimization > 3.1. #define USE_ROOT > 3.2. #undef USE_ROOT > > 4. The code from the point 3 but with Optimization > 4.1. #define USE_ROOT > 4.2. #undef USE_ROOT > 5. remove any ROOT call and replace it with > double y = sin(3.5); > for (int j=0; j < 10;j++) { > y = sin(y); > } > no optimization > ------------------------------ > Duration > 1.1 340 > 1.2 340 > > 2.1 921 > 2.2 2643 (!!!) > > 3.1 17265 > 3.2 19137 > > 4.1 340> 4.2 340 > > 5.1 2673 > 5.2 2633 > ----- ------------------------- > > In other words > when "#define USE_ROOT" is ON the code is FASTER by factor 3 !!! > (see 2.1 and 2.2 ) > > At least my result does contradict YOUR observation. > I don't go further because the code in question is not good to jump > to any kind of the conclusions. > > Have a fun. > > Valeri ________________________________________________________________________ __ Die sicherste Form der Kommunikation: E-Mails verschluesseln, Spam-Filter, Adressverifizierung, digitale Unterschrift: <http://freemail.web.de> http://freemail.web.de
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:14 MET