PDA

View Full Version : Debug/Release in Visual Studio



MikeJarosz
2007-03-14, 02:20 PM
I finally have the API doing what we (Zoog and myself) need. Speed is an issue now. Guy_R brought up the topic of debug and release compilation. I'm sure my dll has debug code in it. It runs really slow, but gets the right results.

One of the help files says "You can switch between Release and Debug versions using the standard toolbar." Well, my tool bar doesn't have anything regarding release. I've been fiddling with help and getting nowhere.

Anyone know how to get there?

GuyR
2007-03-14, 07:16 PM
Mike,

How is your speed now, 23000 objects in ?. Debug or release builds won't speed things up , at least not by any order of magnitude. What I was talking about was running the command under the debugger.

I still find it strange it's so slow. Have you tried commenting out the excel related code and seeing how fast the basic command is? It maybe the office interop.

Can't help you with the VSStudio. I take it it's not the express version which doesn't support debug/release builds. Personally I use Sharpdevelop. The setting will be under the project menu I would imagine.

Guy

MikeJarosz
2007-03-14, 07:39 PM
We're using Visual Studio Professional.

We have some people here who are nervous about getting results, so the Excel stuff was to be able to show progress. I've actually succeeded in calculating a percentage and placing it into a Revit shared parameter, so the Excel part is now superfluous.

Removing the Excel interface is my next step.

MikeJarosz
2007-03-14, 08:23 PM
Got it!!!!!

I removed all traces of Excel. I also found how to do an API build for release. Revit did 29,000+ elements in 25 seconds.

My next suspicion is that there are Microsoft Office development tools that I should be using to minimize the performance hit.

GuyR
2007-03-14, 09:19 PM
Revit did 29,000+ elements in 25 seconds.

25 seconds or .25 seconds? If it's 25 seconds it's still damn slow if you're doing no Office Interop. Doing office Interop the idea is probably to do it once rather than doing a write/read from excel on each loop.

If it is still 25 seconds, try just looping the current object. ie:

while(Itor.MoveNext())
{
Itor.Current;
}

How long does that take for the 29000 object project?

Guy

MikeJarosz
2007-03-14, 10:10 PM
I agree that looping through Excel and assigning one cell at a time is slow.

A trick I use in VBA is to populate a two dimensional array under program control with values calculated by the program. You can them start Excel and move the entire array onto the spreadsheet in a single assignment. I don't know if that will work in this new environment, because in Excel VBA it requires a variant array which I haven't seen here yet.

I got the timing from the stopwatch. I don't think I've got it right yet. Every new feature I encounter means reading a help sheet, understanding new lingo, then trying it out in code. But Zoog is thrilled with the 25 seconds and he's already thinking of new things to do.

I get thrown by "thrown" :Oops:

GuyR
2007-03-14, 11:12 PM
But Zoog is thrilled with the 25 seconds and he's already thinking of new things to do.

I still don't get the 25 seconds. It's only 29000 objects. If you comment out your code and test with a basic loop, it will give you a target. My PC doing a myobject = Itor.Current loop will extract about 50 objects a millisecond. So in theory for 29000 objects this would be 580 milliseconds. The Xeon's should be be around 450 milliseconds? for the same number of objects.

Guy