|
-
Dec 15th, 2011, 09:58 AM
#1
Thread Starter
Hyperactive Member
[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
-
Dec 15th, 2011, 10:11 AM
#2
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.
-
Dec 15th, 2011, 10:30 AM
#3
Thread Starter
Hyperactive Member
Re: Debug Vs Release
Nice one Dbasnett. Thank you.
-
Dec 15th, 2011, 10:57 AM
#4
Thread Starter
Hyperactive Member
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
-
Dec 15th, 2011, 11:55 AM
#5
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
-
Dec 15th, 2011, 12:29 PM
#6
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|