This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
BenchmarkRunner.Run<BenchmarkArraySplit>(); | |
[MemoryDiagnoser] | |
public class BenchmarkArraySplit | |
{ | |
[Benchmark] | |
public string Vabka() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class VarInt { | |
public static bool TryRead(ReadOnlySpan < byte > slice, out int value, out int readBytes) { | |
readBytes = 0; | |
value = 0; | |
var shift = 0; | |
while (true) { | |
if (readBytes >= slice.Length) | |
return false; | |
var nextByte = slice[readBytes++]; |
OlderNewer