Benchmarking C++ operators 2004-06-01 - By Felix Gebhardt
Back Luc-Eric Rousseau wrote: > right, QueryPerformanceCounter is what we > use for mesuring an operator's performance.
Now I only need to actually HAVE your operator's performance. But hey, at least we use the same timer ;)
Thanks for telling, Felix
> -- --Original Message-- -- > From: owner-xsi@(protected) [mailto:owner-xsi@(protected)]On Behalf > Of Felix Gebhardt > Posted At: Tuesday, June 01, 2004 10:08 AM > Posted To: xsi > Conversation: Benchmarking C++ operators > Subject: Re: Benchmarking C++ operators > > > Hi Daniel, thanks for helping out, > > I already had a look at VTune. Like you said. It's way overdosed for my > purpose and too expensive to setup. I will have a look at the MSVC option > but I also found something interesting on codeproject. > http://www.codeproject.com/cpp/precisetimer.asp > > > If there is anything else, keep em coming, > Felix > > > > > Daniel Bachler wrote: >> Well there is Intels Vtune, but it's quite expensive (although I think >> that there is a trial version available) and it can be a bit tough to set >> up so that it returns some usefull information. MSVC has some kind of >> profiler of its own IIRC, but without any graphical representation or >> anything fancy. And, last but not least, you can of course take >> timestamps yourself everytime you operator gets called and everytime it >> returns and measuring that time. If it's something simple I would first >> try the last trick, it's quite fast to setup and very precise, as the >> time you loose on profiling is really negligible. If you want to take it >> a step further you can store an array of simple structures containing >> last starttime and amount of time in that block, then write two small >> function, like this: (C++ style pseudocode) >> >> Void StartBlock(int blockIndex) >> { >> m_ProfilerStructures[blockIndex].m_Starttime = gettime(); >> } >> >> Void EndBlock(int blockIndex) >> { >> m_ProfilerStructures[blockIndex].m_ElapsedTime += gettime() - >> m_ProfilerStructures[blockIndex].m_Startime(); >> } >> >> You can then use it like this: >> >> StartBlock(INIT); >> Initialize(); >> EndBlock(INIT); >> StartBlock(MAIN); >> DoStruff(); >> EndBlock(MAIN); >> >> Daniel >> >>> -- --Original Message-- -- >>> From: owner-xsi@(protected) >>> [mailto:owner-xsi@(protected)] On Behalf Of Felix Gebhardt >>> Sent: Tuesday, June 01, 2004 2:22 PM >>> To: XSI@(protected) >>> Subject: Benchmarking C++ operators >>> >>> Hi all, >>> >>> does anyone happen to have an advise on what's the best way >>> to benchmark >>> compiled operators? In VBS I just would take a time snapshot >>> but it's not >>> too precise. How to nail it down better in C++? Any simple >>> but precise way >>> or free and easy to use analyzer/profiler? >>> >>> Suggestions greatly appreciated, >>> Felix > > --- > Unsubscribe? Mail Majordomo@(protected) with the following text in body: > unsubscribe xsi
--- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|