Results 1 to 5 of 5

Thread: Which one is faster?

  1. #1

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729

    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.MaskAlphat.MaskRedt.MaskGreent.MaskBlue)), 00this.Widththis.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);
    Last edited by PT Exorcist; Jan 14th, 2003 at 06:14 PM.
    \m/\m/

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    both devImplementation and Mask things are proprieties! so the first one should be faster right?
    \m/\m/

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Yep.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    ah tks nice
    \m/\m/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width