Coder Social home page Coder Social logo

leolorenzoluis / microsoft.io.recyclablememorystream Goto Github PK

View Code? Open in Web Editor NEW

This project forked from microsoft/microsoft.io.recyclablememorystream

0.0 2.0 0.0 6.28 MB

A library to provide pooling for .NET MemoryStream objects to improve application performance.

License: MIT License

C# 100.00%

microsoft.io.recyclablememorystream's Introduction

Microsoft.IO.RecyclableMemoryStream NuGet Version

A library to provide pooling for .NET MemoryStream objects to improve application performance.

Get Started

Install the latest version from NuGet (for .NET 4.5 and up)

Install-Package Microsoft.IO.RecyclableMemoryStream

Features

  • The semantics are close to the original System.IO.MemoryStream implementation, and is intended to be a drop-in replacement.
  • Rather than pooling the streams themselves, the underlying buffers are pooled. This allows you to use the simple Dispose pattern to release the buffers back to the pool, as well as detect invalid usage patterns (such as reusing a stream after it’s been disposed).
  • The MemoryManager is thread-safe (streams themselves are inherently NOT thread safe).
  • Each stream can be tagged with an identifying string that is used in logging - helpful when finding bugs and memory leaks relating to incorrect pool use.
  • Debug features like recording the call stack of the stream allocation to track down pool leaks
  • Maximum free pool size to handle spikes in usage without using too much memory.
  • Flexible and adjustable limits to the pooling algorithm.
  • Metrics tracking and events so that you can see the impact on the system.

For more details, refer to the announcement blog post

Build Targets

The code ships utilizing CommonBuildToolset. This provides some build extensions over top of MSBuild to automatically pull NuGet packages from command line build, etc.

MSBuild 15 is required to build the code. You get this with Visual Studio 2017. Cross-platform builds will be documented in a future release.

Testing

We're using Visual Studio 2017 for interactive test work. Requirements:

  • NUnit test adaptor (VS Extension)
  • Be sure to set the default processor architecture for tests to x64 (or giant allocation test will fail)

microsoft.io.recyclablememorystream's People

Contributors

doubleyewdee avatar arikt-ms avatar benmwatson avatar michens avatar stakx avatar selvasingh avatar shiftkey avatar jamesqo avatar vbfox avatar

Watchers

Leo Lorenzo Luis avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.