  | | | Benchmarking C++ operators | Benchmarking C++ operators 2004-06-01 - By Guy Rabiller
Back On factor to enhance the speed of any operator, is to not query the ports and parameters with string names. Rather use indexes with GetPortAt and GetParameters. You might get considerable speed enhancement.
-- guy rabiller | 3d technical director @ LaMaison
Felix Gebhardt wrote:
>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 > > > >
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859 (See http://ISO-8859.ora-code.com)-1"> <title></title> </head> <body> On factor to enhance the speed of any operator, is to not query the ports and parameters with string names.<br> Rather use indexes with GetPortAt and GetParameters.<br> You might get considerable speed enhancement.<br> <pre class="moz-signature" cols="$mailwrapcol">-- guy rabiller | 3d technical director @ LaMaison</pre> <br> <br> Felix Gebhardt wrote:<br> <blockquote type="cite" cite="mid006401c447e9$3ae6c1d0$8202a8c0@(protected)"> <pre wrap="">Luc-Eric Rousseau wrote: </pre> <blockquote type="cite"> <pre wrap="">right, QueryPerformanceCounter is what we use for mesuring an operator's performance. </pre> </blockquote> <pre wrap=""><!----> Now I only need to actually HAVE your operator's performance. But hey, at least we use the same timer ;)
Thanks for telling, Felix
</pre> <blockquote type="cite"> <pre wrap="">-- --Original Message-- -- From: <a class="moz-txt-link-abbreviated" href="mailto:owner-xsi@(protected)" >owner-xsi@(protected)</a> [<a class="moz-txt-link-freetext" href="mailto :owner-xsi@(protected)">mailto:owner-xsi@(protected)</a>]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. <a class="moz-txt-link-freetext" href="http://www.codeproject.com/cpp /precisetimer.asp">http://www.codeproject.com/cpp/precisetimer.asp</a>
If there is anything else, keep em coming, Felix
Daniel Bachler wrote: </pre> <blockquote type="cite"> <pre wrap="">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
</pre> <blockquote type="cite"> <pre wrap="">-- --Original Message-- -- From: <a class="moz-txt-link-abbreviated" href="mailto:owner-xsi@(protected)" >owner-xsi@(protected)</a> [<a class="moz-txt-link-freetext" href="mailto:owner-xsi@(protected)">mailto :owner-xsi@(protected)</a>] On Behalf Of Felix Gebhardt Sent: Tuesday, June 01, 2004 2:22 PM To: <a class="moz-txt-link-abbreviated" href="mailto:XSI@(protected)">XSI @(protected)</a> 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 </pre> </blockquote> </blockquote> <pre wrap="">--- Unsubscribe? Mail <a class="moz-txt-link-abbreviated" href="mailto:Majordomo @(protected)">Majordomo@(protected)</a> with the following text in body: unsubscribe xsi </pre> </blockquote> <pre wrap=""><!----> --- Unsubscribe? Mail <a class="moz-txt-link-abbreviated" href="mailto:Majordomo @(protected)">Majordomo@(protected)</a> with the following text in body: unsubscribe xsi
</pre> </blockquote> <br> <pre class="moz-signature" cols="$mailwrapcol"> </pre> <br> </body> </html>
|
|
 |