Page 1 of 1

Speed Issue

Posted: Thu Sep 15, 2005 10:39 pm
by Jeremy
I'm trying to settle a debate about variables and referencing. We all know what referencing is used for, but now we've got an arguement that unless a variable specifically needs to be copied, that it's better to reference it, because referencing is faster.

While, I don't believe it's a good idea to operate under this programming practice, is it true that referencing is faster than copying?

Edit: Even if it is faster, it's probably a very marginal difference, but I'm still curious. My own personal tests show that referencing is slower, but I'd like a second opinion.

Posted: Thu Sep 15, 2005 10:58 pm
by feyd
that speed is extremely machine dependant. Some machines can copy data very quickly.. the amount of data that needs to be copied also must be taken into account.

You can test the performance fairly easily though.. ;)