profiling objectarx code

profiling objectarx code

Anonymous
Not applicable
356 Views
2 Replies
Message 1 of 3

profiling objectarx code

Anonymous
Not applicable
I need to improve the run time of some of my ObjectARX code. Rather than blindly tweaking things, I would like to know where the code is spending all it's time. MSVC 6 provides some tools for doing this: prep, profile and plist. The MSVC docs are not very helpful for a situation where you want to profile a .dll, but do not have access to the exe source. This article http://www.codeproject.com/isapi/profiling_isapi.asp?target=time%7Cprofile gives steps for profiling ISAPI DLLs which I believe to be analogous to the ObjectARX situation. I follow the steps in that article to prepare my environment and my arx file. But I am stuck because AutoCAD refuses to load my prepped .arx file. Has anybody been successful in using the MSVC profiling toolset on ObjectARX files? If you did get it to work, can you please post a recipe? Thanks -Rodney Schuler
0 Likes
357 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
I won't be much help with the direct question here, since i've never used the profiling tools. However, i did make a quick time stamper that i use to benchmark my apps. One 'manager' object that stores the data, and then a second class that records the times when it is instantiated and when its destructor is called. This was very simple to write, and has been a huge help for me. I just throw one of these variables in at the top of every function, and i can see exactly how much time i spent in each one. I had one particularly slow function - and i was attributing it to a database connection that was being made. But when i started stamping all of my functions i realized that it was not the db, and that in fact one of my functions was going a little crazy with some strings (i was building a rather enormous list, and was basically trying to fake xml by just writing a giant string). After that realization i managed to cut an 80 second process down to 9 seconds! Then again, if i had just done it the right way first instead of trying to take the easy way out i would have also saved myself a week... hehe. "Rodney Schuler" wrote in message news:40916f5b$1_2@newsprd01... I need to improve the run time of some of my ObjectARX code. Rather than blindly tweaking things, I would like to know where the code is spending all it's time. MSVC 6 provides some tools for doing this: prep, profile and plist. The MSVC docs are not very helpful for a situation where you want to profile a .dll, but do not have access to the exe source. This article http://www.codeproject.com/isapi/profiling_isapi.asp?target=time%7Cprofile gives steps for profiling ISAPI DLLs which I believe to be analogous to the ObjectARX situation. I follow the steps in that article to prepare my environment and my arx file. But I am stuck because AutoCAD refuses to load my prepped .arx file. Has anybody been successful in using the MSVC profiling toolset on ObjectARX files? If you did get it to work, can you please post a recipe? Thanks -Rodney Schuler
0 Likes
Message 3 of 3

Anonymous
Not applicable
Thanks for the reply. Having a class that captured time on construction and destruction was my backup plan. I was going to wrap the mess in a preprocessor macro so that it could be turned on/off with by defining a preprocessor symbol. I was hoping to use the MSVC profiler so that I did to have to add a line of code to every function I wished to profile. "Justavian" wrote in message news:4091f7c3_2@newsprd01... > I won't be much help with the direct question here, since i've never used > the profiling tools. However, i did make a quick time stamper that i use to > benchmark my apps. One 'manager' object that stores the data, and then a > second class that records the times when it is instantiated and when its > destructor is called. This was very simple to write, and has been a huge > help for me. I just throw one of these variables in at the top of every > function, and i can see exactly how much time i spent in each one. I had > one particularly slow function - and i was attributing it to a database > connection that was being made. But when i started stamping all of my > functions i realized that it was not the db, and that in fact one of my > functions was going a little crazy with some strings (i was building a > rather enormous list, and was basically trying to fake xml by just writing a > giant string). After that realization i managed to cut an 80 second process > down to 9 seconds! Then again, if i had just done it the right way first > instead of trying to take the easy way out i would have also saved myself a > week... hehe. >
0 Likes