Skip to content

Instantly share code, notes, and snippets.

Petr Onderka svick

Block or report user

Report or block svick

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Program.cs
using System.Collections.Generic;
using System.Linq;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
public class Program
{
static void Main() => BenchmarkRunner.Run<Benchmark>();
}
View Program.cs
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
public class Program
{
static void Main() => BenchmarkRunner.Run<Benchmark<string>>();
}
View Program.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using static System.Reflection.BindingFlags;
class Program
{
static void Main(string[] args)
View ResultsComparer.md
>dotnet run -p ..\..\tools\ResultsComparer\ResultsComparer.csproj --base .\before\ --diff .\after\ --threshold 3%
summary:
better: 65, geomean: 1.629
worse: 10, geomean: 1.548
total diff: 75
Slower diff/base Base Median (ns) Diff Median (ns) Modality
View Progam.cs
using System;
using System.Reflection;
using System.Reflection.Emit;
class Program
{
static void Main()
{
var assembly = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("a.dll"), AssemblyBuilderAccess.Run);
var module = assembly.DefineDynamicModule("a.dll");
View DelayTaskSource.cs
class DelayTaskSource
{
readonly ValueTaskSource valueTaskSource;
readonly object l = new object();
readonly List<(Action<object>, object, short)> continuations = new List<(Action<object>, object, short)>();
readonly Dictionary<short, long> timestamps = new Dictionary<short, long>();
readonly List<short> tokenCache = new List<short>();
readonly Timer timer;
long? timerTimestamp;
short nextToken;
View Program.cs
using System;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
struct MethodDesc
{
const ushort enum_flag3_TokenRemainderMask = 0x3FFF;
static readonly int ALIGNMENT_SHIFT = 3;
static readonly int ALIGNMENT = (1<<ALIGNMENT_SHIFT);
View after.txt
dotnet complete "dotnet add package Mic"
MicCodes.ECharts
MicCodes.Logger
MicCodes.Notify
MicCodes.Sms
MicCodes.Sms.Core
MicCodes.Storage
MicCodes.Tasks
MicDrop
MIConvexHull
View HomeController.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using coremvcapp.Models;
using System.Net;
using System.Runtime.CompilerServices;
View Expression variables in query expressions.md

Expression variables in query expressions (version 4)

An expression variable is considered to be a promoted expression variable, when it's declared in the expression of a second or subsequent from clause, a let clause or a where clause and it's also referenced in one or more following clauses of the same query (but not across an into clause). Such expression variables are promoted into range variables.

Expression variables are allowed in all query clauses, but they affect how the query is translated only if they are promoted expression variables.

Translation

For an expression e with one or more promoted expression variables v1, ..., vn, its expanded form ee is the anonymous object creation expression fragment eo = e, v1, ... vn, where eo is a compiler generated identifier that is invisible and inaccessible, except when mentioned in this section.

You can’t perform that action at this time.