Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Debugging 64bit very slow for C3D 2012 using VS2010 Pro

8 REPLIES 8
Reply
Message 1 of 9
eadonan
847 Views, 8 Replies

Debugging 64bit very slow for C3D 2012 using VS2010 Pro

I'm transitioning from 32bit to 64bit for both development and target builds (in-house development). I made it through the references Smiley Surprised, 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

8 REPLIES 8
Message 2 of 9
Jeff_M
in reply to: eadonan

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.

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 9
Anonymous
in reply to: eadonan

Hi Eric,

 

If you could share a non-confidential code snippet, I can try investigating this further.

 

Thanks,

Message 4 of 9
eadonan
in reply to: Anonymous

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()

 

 

Message 5 of 9
Anonymous
in reply to: eadonan

 

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,

 

Message 6 of 9
eadonan
in reply to: Anonymous

When creating a SurveyNetwork it is always a new network.

The pFile points count will range from 500 to 5000. The typical points count will be on average of 1000 for most of our projects.

The performance is much better at runtime. For 500 points at runtime takes about 13sec, while debugging takes 4min. This is the subject of my post. Why such a large difference between runtime and debugging when using 64bit. Because when I use 32bit (C3D 2012 & VS2010 Express) the runtime is the same 13sec, while debugging takes about 23sec. One would expect 64bit to be faster, but something with the COM references in 64bit is causing a larger than expected difference between runtime & debugging performance.

I was expecting to get a forum response that outlined some 64bit VS2010 configuration settings that would allow it to operate similar to the 32bit performance.

Thanks,
Eric
Message 7 of 9
Anonymous
in reply to: eadonan

Message 8 of 9
Jeff_M
in reply to: Anonymous

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.

Jeff_M, also a frequent Swamper
EESignature
Message 9 of 9
eadonan
in reply to: Anonymous

I changed the setting in the "global" environmental settings. Using Control Panel > System > Advanced system settings > Environmental Variables Added a new variable for _NO_DEBUG_HEAP and set value = 1.

No effect on debugging performance.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report