Performance really depends on your scenario, and always is the case that someone will warn you not to optimise prematurely and find the bottlenecks before assuming something is slow and such and so, and then there are also presumptions from angles that may or may not hold true; I really align with the former part of that, but don't like to jump to conclusions, and think the parts of a program are demonstrated to be slower and hence call out for the need for such as part to be optimised.
With that, anyway, consider the following, primitive, not entirely practical ad hoc program (using your methods, named Dequeue and TryDequeue here, but not listed):
var data = new byte[4096];
var random = new Random();
var queue = new Queue<byte>();
var stopWatch = new Stopwatch();
TimeSpan dequeueTimespan, tryDequeueTimespan;
stopWatch.Restart();
for (int i = 0; i < 1000000; i++)
{
random.NextBytes(data);
foreach (var item in data)
{
queue.Enqueue(item);
}
Dequeue(queue, 1024);
queue.Clear();
}
stopWatch.Stop();
dequeueTimespan = stopWatch.Elapsed;
stopWatch.Restart();
for (int i = 0; i < 1000000; i++)
{
random.NextBytes(data);
foreach (var item in data)
{
queue.Enqueue(item);
}
TryDequeue(queue, 1024);
queue.Clear();
}
stopWatch.Stop();
tryDequeueTimespan = stopWatch.Elapsed;
Console.WriteLine("Dequeue: {0}", dequeueTimespan);
Console.WriteLine("TryDequeue: {0}", tryDequeueTimespan);
Console.ReadKey();
Now, if we run that over 10000 iterations for each, we get:
Dequeue: 00:00:12.6178244
TryDequeue: 00:00:13.6747715
And for 1000000 iterations per method:
Dequeue: 00:02:16.4144764
TryDequeue: 00:02:13.2039597
Granted, we're doing other work here, but it is all relative; we're also exaggerating your case here, as you only require 5 bytes, so...
In the first case of 10000 iterations again:
Dequeue: 00:00:10.5624014
TryDequeue: 00:00:10.2529997
I'm not saying these are perfect, results, but they are results; But the point is this.
That the performance degradation is negligible between the two.
There are also many other factors to consider in a practical environment that, needless to say and not to try and list all variabilities here, you will be (or become) aware of and ought to take the time to tie in to your scenario.