Hi Guys,
Is there a performance difference between these two compiling options?
I've found competing information and wanted the communities opinion.
Cheers,
Nick
Printable View
Hi Guys,
Is there a performance difference between these two compiling options?
I've found competing information and wanted the communities opinion.
Cheers,
Nick
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
Nice one Dbasnett. Thank you.
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
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).
Answer to my follow up was that you had to add another option to the configuration manager.
Cheers everyone!
I'm closing the topic.