Skip to content

Instantly share code, notes, and snippets.

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Attributes.Jobs;
using System;
namespace ConsoleApp2
{
[InProcess]
public unsafe class IsAscii
{
private string _earlyCachedA = "1abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU";
@bbowyersmyth
bbowyersmyth / IndexOfAny.cpp
Created August 4, 2017 01:35
IndexOfAnyCpp
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <chrono>
#include <iostream>
#define PROBABILISTICMAP_BLOCK_INDEX_MASK 0X7
#define PROBABILISTICMAP_BLOCK_INDEX_SHIFT 0x3
#define PROBABILISTICMAP_SIZE 0X8
typedef unsigned short WCHAR;
using BenchmarkDotNet.Attributes;
using System;
namespace ConsoleApplication2
{
[Config("jobs=RyuJitX64")]
public unsafe class LoopWithExit
{
public int length = 100;
using BenchmarkDotNet.Attributes;
using System;
namespace ConsoleApplication2
{
[Config("jobs=RyuJitX64")]
public unsafe class CompareOrdinalIgnoreCase
{
[Params(1, 5, 12, 50, 100)]
public int length = 0;
using BenchmarkDotNet.Attributes;
using System;
namespace ConsoleApplication2
{
[Config("jobs=RyuJitX64")]
public unsafe class CompareOrdinalIgnoreCase
{
[Params(1, 5, 12, 50, 100)]
public int length = 0;
using System;
using System.Diagnostics;
using System.Text;
namespace ConsoleApp2
{
public class Program
{
public static void Main(string[] args)
{
using BenchmarkDotNet.Attributes;
using System;
namespace ConsoleApplication2
{
[Config("jobs=RyuJitX64")]
public class IndexOf
{
// Not found
//[Params(1, 12, 20, 30, 40, 50, 100, 200, 500)]
using BenchmarkDotNet.Attributes;
using System;
namespace ConsoleApplication2
{
[Config("jobs=RyuJitX64")]
public class IndexOf
{
// Not found
[Params(1, 12, 50, 100, 200, 500)]
public static bool ContainsTokenUnroll(string value, string token, char delimiter = ';')
{
if (string.IsNullOrEmpty(token)) return false;
if (string.IsNullOrEmpty(value)) return false;
var valueLength = value.Length;
var tokenLength = token.Length;
if (tokenLength > valueLength) return false;
using BenchmarkDotNet.Attributes;
using System;
namespace ConsoleApplication2
{
[Config("jobs=RyuJitX64")]
public class Pad
{
[Params(1, 10, 50, 90, 100)]
public int length = 0;