ice icon indicating copy to clipboard operation
ice copied to clipboard

Improve Ice memory and allocations

Open bentoi opened this issue 7 years ago • 0 comments

We could look into improving memory allocations for buffers allocated by Ice to read/write the data over the network.

We could look into techniques such as the ones described here: https://www.facebook.com/notes/facebook-engineering/scalable-memory-allocation-using-jemalloc/480222803919

We could consider having a per-thread cache of memory blocks to avoid too much synchronization. I believe it would also be easier and better to do the caching at this lower level rather than doing it at the Incoming/Outgoing level. Instead of caching Incoming/Outgoing we should cache the underlying memory buffers which would be used by our Buffer class.

When marshaling data, we should also consider using multiple memory buffers for the marshaled data rather than always expanding a single memory buffer (which potentially requires data copying). This would also require to add support for vectored IO to our transport so that we can with a single system call write the multiple buffers.

We could also look lino using something like Microsoft.IO.RecycableMemoryStream

bentoi avatar Jul 03 '18 08:07 bentoi