Skip to content

Instantly share code, notes, and snippets.

View redknightlois's full-sized avatar

Federico Andres Lois redknightlois

View GitHub Profile
@redknightlois
redknightlois / memory-copy.txt
Created November 4, 2015 16:06
Benchmark System.Buffer, BlockCopy and RavenDB Sparrow's implementation.
// ***** Competition: Finish *****
```ini
BenchmarkDotNet=v0.7.8.0
OS=Microsoft Windows NT 6.2.9200.0
Processor=Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz, ProcessorCount=4
HostCLR=MS.NET 4.0.30319.42000, Arch=64-bit [AttachedDebugger] [RyuJIT]
Type=MemoryPerf Mode=Throughput Platform=X64 Jit=RyuJit .NET=HostFramework
```
using BenchmarkDotNet.Tasks;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BenchmarkDotNet.Samples.JIT
{
[BenchmarkTask(platform: BenchmarkPlatform.X64, jitVersion: BenchmarkJitVersion.RyuJit, warmupIterationCount: 1, targetIterationCount: 4, processCount: 1)]
public class Jit_StructCopy
@redknightlois
redknightlois / gist:f52db834a071a36621be47e79e0b48dd
Last active May 5, 2016 00:03
Memory Compare Benchmarks with SIMD
// * Summary *
BenchmarkDotNet=v0.9.4.0
OS=Microsoft Windows NT 6.2.9200.0
Processor=Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz, ProcessorCount=4
Frequency=3218751 ticks, Resolution=310.6795 ns, Timer=TSC
HostCLR=MS.NET 4.0.30319.42000, Arch=64-bit RELEASE [RyuJIT]
JitModules=clrjit-v4.6.1078.0
Type=CompareAlgo Mode=Throughput
public static void Main(string[] args)
{
int i = 0;
try
{
checked
{
i++;
};
00007FFAEE230B92 sub esp,20h
00007FFAEE230B95 mov rcx,7FFB4DA35CC8h
00007FFAEE230B9F call 00007FFB4DF47FB0
00007FFAEE230BA4 mov rsi,rax
00007FFAEE230BA7 mov rcx,rsi
00007FFAEE230BAA call 00007FFB4D3EA1D0
00007FFAEE230BAF mov rcx,rsi
00007FFAEE230BB2 call 00007FFB4DD0DD70
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Attributes.Jobs;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Environments;
using BenchmarkDotNet.Horology;
@redknightlois
redknightlois / gist:fc692ca4952596ecd00152f45665a458
Created November 21, 2017 18:31
How to Test and Fix for Intel Management Engine on Windows
If you dont know what we are talking about read:
Intel Chip Flaws Leave Millions of Devices Exposed
https://www.wired.com/story/intel-management-engine-vulnerabilities-pcs-servers-iot/
[Step-by-Step]
1. Download the Intel security advisory detection tool:
https://downloadcenter.intel.com/downloads/eula/27150/Intel-SA-00086-Detection-Tool?httpDown=https%3A%2F%2Fdownloadmirror.intel.com%2F27150%2Feng%2FSA00086_Windows.zip
@redknightlois
redknightlois / how-to-install.md
Last active September 30, 2023 19:13
How to update your Intel Management Engine
@redknightlois
redknightlois / diff.cs
Created February 2, 2018 20:28
Diffing memory example
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
namespace Sparrow.Utils
{
/// <summary>
/// This class computes a diff between two buffers and write
/// the diff to a temp location.
///
using System;
using System.Linq;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics.X86;
using System.Runtime.InteropServices;
using BenchmarkDotNet.Analysers;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Columns;
using BenchmarkDotNet.Configs;