NTDLS.FastMemoryCache 1.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package NTDLS.FastMemoryCache --version 1.3.0
                    
NuGet\Install-Package NTDLS.FastMemoryCache -Version 1.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NTDLS.FastMemoryCache" Version="1.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NTDLS.FastMemoryCache" Version="1.3.0" />
                    
Directory.Packages.props
<PackageReference Include="NTDLS.FastMemoryCache" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NTDLS.FastMemoryCache --version 1.3.0
                    
#r "nuget: NTDLS.FastMemoryCache, 1.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=NTDLS.FastMemoryCache&version=1.3.0
                    
Install as a Cake Addin
#tool nuget:?package=NTDLS.FastMemoryCache&version=1.3.0
                    
Install as a Cake Tool

NTDLS.FastMemoryCache

Provides fast and easy to use partitioned memory cache for C# that helps manage the maximum size and track performance.

Quick and easy eample of a file cache:

Using the memory cache is easy, just initialize and upsert some values. You can also pass a configuration parameter to set max memory size, cache scavange rate and partition count.

readonly PartitionedMemoryCache _cache = new();

public string ReadFileFromDisk(string path)
{
    string cacheKey = path.ToLower();

    if (_cache.TryGet<string>(cacheKey, out var cachedObject))
    {
        return cachedObject;
    }

    string fileContents = File.ReadAllText(path);
    _cache.Upsert(cacheKey, fileContents, fileContents.Length * sizeof(char));
    return fileContents;
}

License

Apache-2.0

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NTDLS.FastMemoryCache:

Package Downloads
NTDLS.KitKey.Server

A low latency, high-performance, and reliable persistent or ephemeral key-value store over TCP/IP.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.9.2 147 2 months ago
1.9.1 137 4 months ago
1.9.0 194 6 months ago
1.7.14 101 6 months ago
1.7.13 132 6 months ago
1.7.12 152 6 months ago
1.7.11 137 6 months ago
1.7.10 141 7 months ago
1.7.9 120 8 months ago
1.7.8 129 8 months ago
1.7.7 117 8 months ago
1.7.6 128 8 months ago
1.7.5 169 8/25/2024
1.7.4 161 8/24/2024
1.7.3 164 8/24/2024
1.7.2 149 8/24/2024
1.7.1 164 8/13/2024
1.7.0 100 8/3/2024
1.6.4 153 8/1/2024
1.6.3 111 8/1/2024
1.6.2 117 8/1/2024
1.6.1 111 8/1/2024
1.6.0 109 8/1/2024
1.5.4 113 8/1/2024
1.5.3 116 7/31/2024
1.5.2 145 6/20/2024
1.5.1 178 1/22/2024
1.5.0 204 12/7/2023
1.4.4 186 11/15/2023
1.4.3 167 11/10/2023
1.4.2 160 11/3/2023
1.4.1 168 10/17/2023
1.4.0 179 10/12/2023
1.3.0 176 10/11/2023

Added new metrics, added new access methods, faster size calculations.