Optimization ended up in casting an object at each method call
- by Aybe
I've been doing some optimization for the following piece of code :
public void DrawLine(int x1, int y1, int x2, int y2, int color)
{
_bitmap.DrawLineBresenham(x1, y1, x2, y2, color);
}
After profiling it about 70% of the time spent was in getting a context for drawing and disposing it.
I ended up sketching the following overload :
public…