Is there a reason why identical math operations in one Silverlight application will be significantly longer than in another?
For example, I have code that takes a list of points and converts them (scales and translates them) and populates another list of points. It is important that I keep the starting points intact, hence the second list.
Here's the corresponding code (scale is double, and origin is a point):
public Point transformPoint(Point point) {
point.X = (point.X - origin.X) * scale;
point.Y = (point.Y - origin.Y) * scale;
return point;
}
Here's how I do the cycle and time, in case it matters:
DateTime startTime = DateTime.Now;
foreach (Point point in rawPoints) transformedPoints.Add(transformPoint(point));
Debug.Print("ASPX milliseconds: {0}", (DateTime.Now - startTime).Milliseconds);
When you run 14356 points (donβt ask, he modeled the real world number in the desktop application), the breakdown is as follows:
Silverlight application # 1: 46 ms
Silverlight app # 2: 859 ms
- , MainPage. , , . , , ?
, - , - , .