C# - Default library has better performance? -


Earlier today I made myself a light memory stream, which basically writes a byte array. I thought I wanted to see both of them benchmark whether there is any difference - and there was:

(write 1 byte in the array) MemoryStream: 1.0001ms My: 3.0004ms

Everyone tells me that MemoryStream basically provides a byte array and a bunch of ways to work with it.

My question: Is there a slightly better performance than the code written in the default C # library? (Maybe it runs in the release instead of debug?)

.NET implementation was probably slightly better its own But, how did you do the benchmark? Some million iterations, or something? Remember that you need to use a large test base so that you can eliminate some data (the CPU is said away for a moment, etc.) which will give false results.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -