Results 1 to 18 of 18

Thread: What does the With statement do internally?

Threaded View

  1. #4
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    6,203

    Re: What does the With statement do internally?

    Quote Originally Posted by sancarn View Post
    has no performance benefits over

    Code:
    A.B=1
    A.C=2
    A.D=3
    ?
    If A is a member variable there *are* performance benefits. With statement is transformed to this

    Code:
    Dim __hidden_A As __TypeOfA
    Set __hidden_A = A
    __hidden_A.B = 1
    __hidden_A.C = 2
    __hidden_A.D = 3
    Because __hidden_A is on the stack while A is actually this->A (a member variable) there are several instructions (or more) saved.

    cheers,
    </wqw>

Tags for this Thread

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