$/
artifacts/
build/
docs/
lib/
packages/
samples/
src/
tests/
void Main() | |
{ | |
BenchmarkRunner.Run<TypeBenchmark>(); | |
BenchmarkRunner.Run<FieldsBenchmark>(); | |
BenchmarkRunner.Run<PropertiesBenchmark>(); | |
BenchmarkRunner.Run<MethodsBenchmark>(); | |
} | |
// Define other methods and classes here | |
[MemoryDiagnoser] |
We can do this by experimenting with .config files.
Many defenders catch/detect files that are renamed, they do this by matching Original Filename to Process Name
In this example, we don't have to rename anything. We simple coerce a trusted signed app to load our Assembly.
We do this by directing the application to read a config file we provide.
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width" /> | |
<title>Blazor Loading</title> | |
<base href="/" /> | |
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" /> | |
<link href="css/site.css" rel="stylesheet" /> | |
</head> |
Binary search is theoretically optimal, but it's possible to speed it up substantially using AVX2 and branchless code even in .NET Core.
Memory access is the limiting factor for binary search. When we access each element for comparison a cache line is loaded, so we could load a 32-byte vector almost free, check if it contains the target value, and if not reduce the search space by 32/sizeof(T)
instead of 1 element.
AVX512 with _mm256_cmpge_epi64_mask
instruction should improve it even more, but it is not available on .NET yet.
SearchBench
#/usr/bin/python3 | |
import json | |
import sys | |
import os | |
import re | |
import copy | |
input = sys.argv[1] |