-
Which one is faster?
i remember to see in a topic i think that this first piece of code would be faster than the second one:
PHP Code:
System.Deviantart.Implementation t = this.devImplementation;
e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(t.MaskAlpha, t.MaskRed, t.MaskGreen, t.MaskBlue)), 0, 0, this.Width, this.Height);
second:
Code:
System.Deviantart.Implementation t = this.devImplementation;
e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(this.DevImplementation.MaskAlpha, this.DevImplementation.MaskRed, this.DevImplementation.MaskGreen, this.DevImplementation.MaskBlue)), 0, 0, this.Width, this.Height);
-
Assuming MaskAlpha etc. are constants there should be exactly zero difference in the byte code.
If this.devImplementation is a real field and not a property and the masks are runtime values then there should be zero difference too (except if the compiler is VERY stupid, but I can't imagine that).
But if this.devImplementation is a property (with get and set) and the masks are runtime values then the first is faster.
-
both devImplementation and Mask things are proprieties! so the first one should be faster right?
-
-