Results 1 to 6 of 6

Thread: [RESOLVED] Debug Vs Release

  1. #1

    Thread Starter
    Hyperactive Member nickwrs's Avatar
    Join Date
    Jan 2000
    Location
    Atlanta, Ga
    Posts
    398

    Resolved [RESOLVED] Debug Vs Release

    Hi Guys,
    Is there a performance difference between these two compiling options?
    I've found competing information and wanted the communities opinion.
    Cheers,
    Nick

  2. #2
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Debug Vs Release

    Yes, because of optimization and symbolic debug information. Release will almost always be faster, and smaller.

    http://msdn.microsoft.com/en-us/libr...VS.100%29.aspx

    Here is some nonsense code. Run it with debug and release and note the time difference.

    Code:
    Public Class Form1
    
        Dim stpw As New Stopwatch
    
        Dim ipsumA() As String = New String() {"Lorem", "ipsum", "dolor", "sit", _
                                               "amet", "consectetur", "adipisicing", _
                                               "elit", "sed", "do", "eiusmod", _
                                               "tempor", "incididunt", "ut", "labore", _
                                               "et", "dolore", "magna", "aliqua", "Ut", _
                                               "enim", "ad", "minim", "veniam", "quis", _
                                               "nostrud", "exercitation", "ullamco", _
                                               "laboris", "nisi", "ut", "aliquip", "ex", _
                                               "ea", "commodo", "consequat", "Duis", "aute", _
                                               "irure", "dolor", "in", "reprehenderit", "in", _
                                               "voluptate", "velit", "esse", "cillum", "dolore", _
                                               "eu", "fugiat", "nulla", "pariatur", "Excepteur", _
                                               "sint", "occaecat", "cupidatat", "non", "proident", _
                                               "sunt", "in", "culpa", "qui", "officia", "deserunt", _
                                               "mollit", "anim", "id", "est", "laborum"}
    
        Const tries As Integer = 200000
    
        Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
            stpw.Restart()
            For z As Integer = 1 To tries
                For idx As Integer = 0 To ipsumA.Length - 1
                    Dim bar As New foo
                    bar.z = z \ 3
                    bar.idx = idx * bar.z
                    bar.s = ipsumA(idx).Replace("*"c, " "c)
                    bar.prod = z * idx
                Next idx
            Next z
            stpw.Stop()
            Label1.Text = stpw.Elapsed.ToString
        End Sub
    
        Class foo
            Property z As Long
            Property idx As Long
            Property s As String
            Property prod As Double
        End Class
    End Class
    Last edited by dbasnett; Dec 15th, 2011 at 10:26 AM.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  3. #3

    Thread Starter
    Hyperactive Member nickwrs's Avatar
    Join Date
    Jan 2000
    Location
    Atlanta, Ga
    Posts
    398

    Re: Debug Vs Release

    Nice one Dbasnett. Thank you.

  4. #4

    Thread Starter
    Hyperactive Member nickwrs's Avatar
    Join Date
    Jan 2000
    Location
    Atlanta, Ga
    Posts
    398

    Re: Debug Vs Release

    Quick Follow up:
    If I set my target cpu in advanced compile options to x64, is there a reason why I can't change the platform from "Active x86" on the compile tab of my project browser?

    Thanks,
    Nick

  5. #5
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: Debug Vs Release

    I created a set of classes to parse X12 transactions. To test performance I parsed 215 Mb of data with both debug and release builds of the parsing classes and the harness I used to call the parsing classes. All of the times were within seconds of each other. I've always migrated debug builds with the pdb files because when something erred the stack trace information was more helpful (gives you specific line numbers).
    That is the very essence of human beings and our very unique capability to perform complex reasoning and actually use our perception to further our understanding of things. We like to solve problems. -Kleinma

    Does your code in post #46 look like my code in #45? No, it doesn't. Therefore, wrong is how it looks. - jmcilhinney

  6. #6

    Thread Starter
    Hyperactive Member nickwrs's Avatar
    Join Date
    Jan 2000
    Location
    Atlanta, Ga
    Posts
    398

    Re: Debug Vs Release

    Answer to my follow up was that you had to add another option to the configuration manager.
    Cheers everyone!
    I'm closing the topic.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width