Boost logo

Boost :

Subject: Re: [boost] [xpressive] Performance Tuning?
From: Edward Grace (ej.grace_at_[hidden])
Date: 2009-07-19 14:10:44


On 19 Jul 2009, at 14:34, Joel de Guzman wrote:

> Edward Grace wrote:
>
>> The actual generic_timer is chronometer agnostic (or should be) so
>> any
>> function you have to get a given high precision time should just
>> 'go'.
>> Perhaps if you post up your timer I can try that - or at least
>> make an
>> interface that will work.
>
> I believe Overmind posted that sometime ago included in the 7Z file
> "Spirit_Price_Code1.7z"

Hi Joel,

It appears to be in your SVN tree - however it doesn't really help.
It seems to be unapologetically Windows only.

I tried to compile your example but was unsure of what to pull from
the SVN tree. Is it Spirit2? Could you please supply the precise
svn repository? I tried these two:

   svn checkout https://spirit.svn.sourceforge.net/svnroot/spirit/
trunk/final/boost/
   svn checkout https://spirit.svn.sourceforge.net/svnroot/spirit/
trunk/Spirit2x/

but wasn't sure which (if anything) was correct, so didn't know if
the errors I was getting were because I was looking at the wrong
thing or doing something dim.

Regarding a cross-platform high frequency timer, I have uploaded
"cycle.h" from the FFTW project to the Boost Vault,

http://tinyurl.com/maylnc

This appears to support a wide variety of platforms and compilers in
a transparent manner. You end up with a call to a function of the form.

    ticks getticks();

on whatever platform you are using (thanks to some macro magic). It
should work just fine with Windows and MSVC.

The following

#include "cycle.h"
#include <iostream>
int main() {
        std::cout << getticks() << std::endl;
        return 0;
}

should spit out a large number, usually the number of clock cycles
since the CPU started.

$ g++-4 -ansi -pedantic test.cpp
In file included from test.cpp:3:
cycle.h:172: warning: ISO C++ 1998 does not support 'long long'
$ ./a.out
32572590328070

If you could confirm that the above snippet works for you and the
appropriate SVN repository I'll have a bash at that timing again.

After all, if it's written in a standards compliant platform agnostic
manner if it works for me it's got to work for you ---------- right? ;-)

Cheers,

-ed


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk