Skip to content

Instantly share code, notes, and snippets.

// Input: a 32-bit integer of the form [ 00wwwwww 00xxxxxx 00yyyyyy 00zzzzzz ]
// Output: a 32-bit integer where each input byte is mapped to its corresponding BASE64 ASCII byte
private static uint ByteToBase64(uint b)
{
b += 0x41414141U; // 'A'
return b
+ (0x06U * (((b + 0x25252525U) & 0x80808080U) >> 7))
- (0x4BU * (((b + 0x0B0B0B0BU) & 0x80808080U) >> 7))
- (0x0FU * (((b + 0x01010101U) & 0x80808080U) >> 7))
+ (0x03U * ((b & 0x80808080U) >> 7));

Redis 4.2 roadmap

  1. Redis Cluster
  • Speed up key -> hashslot association. Now makes RBB loading 4x slower when there are many small keys.
  • Better multi data center story
  • redis-trib C coded and moved into redis-cli
  • Backup / Restore of Cluster
  • Non blocking MIGRATE (also consider not using 2X memory)
  • Faster resharding
  • Bug fixing and stress testing to bring it to next level of maturity
@NickCraver
NickCraver / DmpAnalysis.linq
Last active May 1, 2024 21:09
DMP Analysis in LinqPad
<Query Kind="Program">
<NuGetReference Prerelease="true">Microsoft.Diagnostics.Runtime</NuGetReference>
<Namespace>Microsoft.Diagnostics.Runtime</Namespace>
<Namespace>System</Namespace>
<Namespace>System.IO</Namespace>
<Namespace>System.Linq</Namespace>
<Namespace>System.Text</Namespace>
<Namespace>Microsoft.Diagnostics.Runtime.Utilities</Namespace>
</Query>
@Scooletz
Scooletz / SqlClientSqlCommandSet.cs
Created September 11, 2015 05:19
System.Data.SqlClient.SqlCommandSet extracted from Data internals, better than NHibernate, as no delegates creation is required beside the first static ctor
public class SqlClientSqlCommandSet : IDisposable
{
private static readonly Type SqlCmdSetType;
private readonly object _instance;
private int _countOfCommands;
private readonly static Action<object, SqlConnection> SetConnection;
private readonly static Func<object, SqlConnection> GetConnection;
private readonly static Action<object, SqlTransaction> SetTransaction;
private readonly static Func<object, SqlCommand> GetCommand;