Someone told me that this:
Is better than this:
Is that true? Thanks.
asked Jan 01 '12 at 04:44 PM
CompareTag compiles to fewer CIL instructions than the direct comparison, for sure: it probably results in a single call to the CompareTag internal function, while the other alternative will need a call to the tag getter function (to get the tag string) and another call to the string comparison function, all of this in CIL (the interpreted language used in .NET applications). Since the tag string must be returned by the getter function, space must be allocated, what takes extra time.
answered Jan 01 '12 at 05:19 PM