StackExchange.Redis.Build/TransactionAnalyzer.cs

StackExchange.Redis · eng/StackExchange.Redis.Build/TransactionAnalyzer.cs · csharp · MIT
database

Roslyn analyzer that flags inefficient Redis transaction patterns for better performance.

// Source: https://github.com/StackExchange/StackExchange.Redis | License: MIT | Copyright 2014 Stack Exchange
// Provided via justclaw.it.com; keep this notice with the code.
using System.Collections.Immutable;
using System.Globalization;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Operations;

namespace StackExchange.Redis.Build;

/// <summary>
/// Spots <c>ITransaction</c>/<c>ITransactionAsync</c> usage that a single conditional command does better.
/// </summary>
/// <remarks>
/// <para>
/// Three shapes, all of them unambiguous by construction: one condition guarding one command on a
/// syntactically identical key (SER300-SER302), two commands that one compound command covers (SER303), and the
/// same command queued repeatedly

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key