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
module Program | |
open System | |
open System.Collections.Generic | |
open System.Diagnostics | |
let r = Random 42 | |
let count = 1000000 | |
let checkValueDate = DateTime (1980, 2, 18) |
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
open System | |
open System.Diagnostics | |
let check<'a when 'a : equality>(x:'a, y:'a) = | |
for i=1 to 0 do failwith "this is just to stop f# inlining" | |
if x = y then 1 else 0 | |
let count = 50000000 | |
let tuple2 () = |
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
namespace Test | |
module HackedOutOfPrimTypes = | |
open System | |
open System.Collections | |
open System.Collections.Generic | |
open System.Reflection | |
open System.Runtime.CompilerServices | |
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
type KeyStruct(_1':int, _2':int, _3':int) = struct | |
member this._1 = _1' | |
member this._2 = _2' | |
member this._3 = _3' | |
end | |
type KeyGenericStruct<'a>(_1':'a, _2':'a, _3':'a) = struct | |
member this._1 = _1' | |
member this._2 = _2' | |
member this._3 = _3' |
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
.assembly hello {} | |
.class public auto ansi serializable beforefieldinit Library1.JumpBImpl`1<class (class [mscorlib]System.IEquatable`1<!a>) a> | |
extends [mscorlib]System.Object | |
{ | |
.method public specialname rtspecialname | |
instance void .ctor () cil managed | |
{ | |
.maxstack 8 |
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
let depth = 1000000 | |
module Test = | |
let check basis createItem = | |
let rec createList n l = | |
if n = 0 then l | |
else createList (n-1) (createItem (int64 n, int64 n) l) | |
let a0 = createList depth basis | |
let a1 = createList depth basis |
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
open System | |
open System.Threading | |
open System.Threading.Tasks | |
open System.Diagnostics | |
let bindBool (f: bool -> Task<bool>) (m: Task<bool>) = | |
if m.IsCompleted | |
then | |
f m.Result | |
else |
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
module SomeNamespace.String | |
open System | |
open System.Globalization | |
let inline private safe s = | |
match s with | |
| null -> String.Empty | |
| _ -> s |
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
/// BenchmarkDotNet Notes: | |
/// Docs/Github: https://github.com/PerfDotNet/BenchmarkDotNet#getting-started | |
/// | |
/// This benchmarking suite will perform JIT warmups, collect system environment data | |
/// run multiple trials, and produce convenient reports. | |
/// You will find csv, markdown, and and html versions of the reports in .\BenchmarkDotNet.Artifacts\results | |
/// after running the tests. | |
/// | |
/// Be sure to run tests in Release mode, optimizations on, etc. |
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
module NotFastInBenchmarkDotNet | |
open System.Runtime.InteropServices | |
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
// NOTE THAT THIS IS NOT PARTICULARLY PORTABLE, AS I'M RELYING ON PARTICULAR ENDIANNESS | |
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
[<Struct; StructLayout (LayoutKind.Explicit); NoComparison; NoEquality>] | |
type private BoolToUint32 = |
OlderNewer