How does communication between account and platform affect speed of a program?

 
I made a script -out of curiousity- about how much time different functions take to be run. (That is how many times does a loop containing the tested functions run in a second).
I found that different account/order information functions are quite fast, not really affecting the result. (eg. a Comment function takes 2500 times more than an OrderSelect()/OrderProfit combo on one opened trade)

What I would like to know is how these information are taken from the server really? I mean it is too fast to inquire the server for each and every functions that need server info. So how are these data transferred?
So far I've always tried to use as few "server info" functions as possible (I rather filled an array, than OrderSelect looping twice in an EA) , since I thought it could slow the program, but apparently I wasn't right with this approach. Or was I?