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

Is there an open source WebSockets (JavaScript) XMPP library? -

java - Is there an object like a "Set" that can contain only unique string values, but also contain a count on the number of occurrences of the string value? -

iphone - How do I make a UIPickerView in a UIActionSheet -