I'm transitioning from 32bit to 64bit for both development and target builds (in-house development). I made it through the references , then tested an existing command that use to take 22sec to complete while debugging in 32bit; now it takes nearly 4min. Now if I build the .dll and netload (not debugging just open C3D) the process takes 13sec on either a 32bit or 64bit machine. Good news for the end users, but painful for the developer.
The command is basically reading an XML file and creating a new survey project, network and adding each point individually to the network using COM.
Is there some setting in VS2010 Pro that would slow debugging down that significantly?
Or have I got a COM reference from the wrong place or something like that?
I’ve tried switching the Target CPU to just 64bit, and messing with the optimizations, but no luck so far.
Below are the references I’m using in this project.
C:\Program Files\Autodesk\AutoCAD Civil 3D 2012\
AeccDbMgd.dll
AecBaseMgd.dll
\Object ARX 2012\inc\
AcDbMgd.dll
AcMgd.dll
\objectARX 2012\inc-x64
acax18ENU.tlb
axdb18enu.tlb
C:\Program Files\Common Files\Autodesk Shared
AecXBase##.tlb
AecXUIBase##.tlb
C:\Program Files\Common Files\Autodesk Shared\Civil Engineering 90
AeccXLand.tlb
AeccXUiLand.tlb
Thanks to this post for the above references.
Thanks,
Eric
Win 7 Enterprise
Intel i7 2.7GHz
32GB RAM
Civil 3D 2012 64bit sp4
VS2010 Pro
Win XP Pro
Intel i7 2.8GHz
4GB RAM
Civil 3D 2012 32bit sp4
VS2010 Express
While I don't have a solution for you, I can say I'd like to know the answer myself. Most slow downs I've encountered occur when accessing/looping through, the points collection. We have a DisplayPoints command that places the point info in a DataGridView. When debugging this can take several minutes, yet just seconds in a normal environment. So I make sure to Debug these portions of code using drawings with minimal data in them.
Below is a code snippet from the Sub that is called to create the survey points in the survey database. Also the foreach loop shown in the snippet is where the significant slowdown is occurring. The code is taken from inside a using transaction that is only called once per command.
Also note, I'm having same experience with creating figures. But, no apparent performance degradation when only using .net objects e.g. surfaces. The significant issues appear to be coming from any repetitive loops involving COM objects and specifically during creation of those objects.
'Survey Points ================================================================ 'Create Non-Control Points for network Dim oNonControlPt As AeccSurveyNonControlPoint = Nothing Debug.WriteLine("Start PointCreation... ") Dim openProject As AeccSurveyProject = oSurveyNetwork.Project Dim nextNumber As Integer = 0 If openProject IsNot Nothing Then nextNumber = openProject.GetNextWritablePointNumber End If Debug.WriteLine("AddPointsSetupDone" & ((My.Computer.Clock.TickCount - startTime) / 1000).ToString("F2")) For Each xPoint In pFile...<Point> Try Dim xNumber As Integer = xPoint.<Number>.Value Dim xName As String = xPoint.<Name>.Value Dim xLabel As String = xPoint.<Label>.Value Dim xCode As String = xPoint.<Code>.Value Dim xEast As Double = ConvertUSfttoM(xPoint.<Grid>.<East>.Value) Dim xNorth As Double = ConvertUSfttoM(xPoint.<Grid>.<North>.Value) Dim xElevation As Double = ConvertUSfttoM(xPoint.<Grid>.<Elevation>.Value) 'Create a NonControl point for each xPoint in the pFile oNonControlPt = oSurveyNetwork.NonControlPoints.Create( _ xNumber, _ xName, _ xCode, _ xEast, _ xNorth, _ xElevation) Dim xlabelEd = Nothing If xLabel IsNot Nothing Or xLabel IsNot "" Then xlabelEd = """" & xLabel & """" 'ed.WriteMessage(xName & "(" & xNumber & ")" & vbTab & vbTab & xCode & vbCrLf) ed.WriteMessage(String.Format("{0,-6}({1}){2,10}{3,-60}{4}", _ xName, xNumber, vbTab, xCode, vbCrLf)) Debug.WriteLine(xNumber & vbLf & _ xName & vbLf & _ xCode) Debug.WriteLine("EachPoint" & ((My.Computer.Clock.TickCount - startTime) / 1000).ToString("F2")) Catch ex As System.ArgumentException Debug.WriteLine(String.Format("{0,-6}({1}){2,10}{3,-60}", _ xPoint.<Name>.Value, vbTab, xPoint.<Code>.Value)) End Try Next Debug.WriteLine("End PointCreation... ") 'Add all newly created points to the drawing oSurveyNetwork.AddPointsToDrawing() Debug.WriteLine("TotalTime" & ((My.Computer.Clock.TickCount - startTime) / 1000).ToString("F2")) ed.WriteMessage("TotalTime" & ((My.Computer.Clock.TickCount - startTime) / 1000).ToString("F2") & vbCrLf) trans.Commit()
Ok, I see you are using Civil 3D 2012 and COM objects. If I remember correctly there were some performance related issues using COM API.
Having said that, since we don't have many API available in pure .NET yet, we need to use COM.
Do you create a new SurveyNetwork or access an existing one ? [ for oSurveyNetwork ] ?
And how many points you have in your pFile ?
Also, do you see a better performnace in runtime compared to debugging ?
Thanks,
Could you check if this helps ?
http://mackeblog.blogspot.in/2009/02/disabling-visual-studios-debugger-heap.html
Thanks,
This did not help with the slow actions during debug sessions for me. Using strictly the .NET API, filling a DataGridView with CogoPoint information in C3D2014....during Debug takes ~72 seconds to fill with 693 points. The same points in a normal startup session load into the same DGV in less than a second.
Can't find what you're looking for? Ask the community or share your knowledge.