Please forgive me if I've misunderstood you, but I feel that you are presenting an XY Problem here (see http://xyproblem.info/ )
To help us identify how to help you properly, please describe your project in more detail. Specifically:
What is the name of your project? (If your project doesn't have a name, tell us the name of your unit/subject/course)
Why are you required to use OPC UA? What does your professor want you to learn? (This really doesn't make sense to me, because OPC UA is not really designed for transferring waveforms)
Why do you want to run the server "as fast as possible"?
Who does the sampling? The server or the client?
The time difference and phase difference is mainly due to the lag in transferring the data from your server to your client, right? Are you interested in measuring that lag?
Sampling rate is only relevant when you convert a physical (real) signal to a digital signal. OPC UA only transmits digital data; it does not do any conversion.
Why do you think there will be noise or change in frequency? OPC UA transmits digital data. As long as the client doesn't lose any part of the data, the data will be received perfectly at the other side, without noise.
You need 3 things:
First, you must make sure you understand the types of comparisons that you want to do. This is the theory you learn from your professor and/or your textbooks.
Next, you must identify algorithm for performing your comparisons. There might already be an algorithm available in your textbooks, or you might need to think of one, or you might be able to ask someone who knows.
Finally, you must write a program that uses that algorithm to perform your comparisons.
We can help you with #3 quite easily (after you finish #1 and #2), but I'm not sure if we can help you with #1.
Forget about LabVIEW programming for now. Consider these sine waves:
What kind of comparisons do you want to do on them? Which differences are you interested in?