Would have to test it with a thousand units sliding.
Edit: Moved to sliding system.
Edit2: By the way
1.24d stopped SetUnitPosition from cancelling orders, so to make it fair you need
call IssueImmediateOrder(u,"stop") in the first code as well.
Edit3: Also, SetUnitPosition() is worse because of its pathability checking being slow. But stopping the unit also checks pathability, so a conclusive result can only be achieved through testing.
I prefer SetUnitX and Y because they are direct control over the unit with nothing getting in the way. We can slide over cliffs, and through buildings, etc.
Edit 4: Optimized code looks messy by default :) It doesn't bother me. But again, only optimize code that is executed frequently, like over 33 times per second.