[Mono-list] Array.CopyTo - Mono (Ubuntu) vs .Net (Windows)

const86 powerdeth at narod.ru
Sat Jul 27 17:56:29 UTC 2013


Write module buffering online video stream for the player. I write it as
follows:
Buffer.BlockCopy (buf, 0, _buffer, _length, length);
where:
buf-what record
_buffer - where to write
_length - buffer size
length - the length of bytes to write

Reads the bytes from buffer:
  byte [] outbs = new byte [_buffer.Length];
Buffer.BlockCopy (_buffer, 0, outbs, 0, length); / / copy the block of a
certain size
/ / Delete the data read from the buffer
var buf = new byte [_buffer.Length];
Buffer.BlockCopy (_buffer, length, buf, 0, _buffer.Length - length);
_buffer = new byte [_buffer.Length];
Buffer.BlockCopy (buf, 0, _buffer, 0, buf.Length);
_length - = length;

/ / Return the read data

return outbs;


.Net (Windovs) this algorithm is very fast. So the difference that no buffer
that is almost negligible.
In a mono (Ubuntu), this algorithm operates so slowly that for every 2
seconds viewing awaits player 5.

Question. How to improve the algorithm in mono, that he was able to cope
with the flow in rialtaym.

P.S. Sorry for the bad English. This is the Google Translate. I do not know
English so much on what to ask such questions :).



--
View this message in context: http://mono.1490590.n4.nabble.com/Array-CopyTo-Mono-Ubuntu-vs-Net-Windows-tp4660316.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list