I have a test loop processing 1,000,000 records of timestamped information (The final application will need to process 100 to 1000 time more data).
I am having a performance issue using DateTime vs using the Deprecated Date. Example 1 takes 20 seconds to execute. Not great but not bad considering the number or rows. Example 2 takes 112 seconds, this will be unacceptable in the final application.
Example 1
For i as Integer = 0 to 1000000
Var d As New Date
d.TotalSeconds = v.TimeStamp + k1 // k1 is a constant
next i
Example 2
For i as Integer = 0 to 1000000
Var d As New DateTime(v.TimeStamp + k2, Nil) // k2 is another constant which makes the result the same
next i
Am I doing something wrong or is DateTime over 5x slower than Date? Will the Date function eventually disapear?