View seq_perf_data_analysis.fs
open System
open System.IO
type Test = {
Core : string
Bittage : string
Name : string
Time : float
}
View tbm_euler_5.fs
open System.Diagnostics
module ``TheBurningMonk - Euler`` =
// collated from :- https://github.com/theburningmonk/ProjectEuler-FSharp-Solutions/tree/master/ProjectEulerSolutions/ProjectEulerSolutions
// documentation :- http://theburningmonk.com/project-euler-solutions/
open System
open System.Numerics
let inline private validate expected received =
if expected <> received then
View burning_monk_euler.fs
open System.Diagnostics
#if !INCLUDE_PROJECT_INFO
module ProjectInfo =
let Name = "Unknown"
let AppendResultTo = None
#endif
[<AutoOpen>]
module Helpers =
View primes.fs
let countPrimes n =
let rec outer count i =
if i <= n then
let sqrtI = int (floor (sqrt (float i)))
let rec inner j =
if j <= sqrtI then
if i % j <> 0 then
inner (j+1)
else
false
View array_performance.fs
open System.Diagnostics
let sum1 (a:array<_>) total =
total := 0
for i = 0 to a.Length-1 do
total := !total + a.[i]
!total
let sum2 (a:array<_>) total =
total := 0
View lazy_regression.cs
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Threading;
using System.Reflection;
namespace LazyTest
{
[TestClass]
public class LazyRegressionTests
{
View seq_test.fs
open System.Diagnostics
let createViaStateMachine data =
seq {
for item in data do
if item % 13L <> 0L then
let item2 = item * item
if item2 % 11L <> 0L then
yield item2 }
View seq.fs
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.FSharp.Collections
#nowarn "52" // The value has been copied to ensure the original is not mutated by this operation
open System
open System.Diagnostics
open System.Collections
open System.Collections.Generic
open Microsoft.FSharp.Core
View performance.fs
open System.Diagnostics
let createSources size f = [
"array", (lazy (Array.init size f :> seq<_>))
"list", (lazy (List.init size f :> seq<_>))
"computation expression", (lazy (seq {
let mutable x = 0
while x < size do
View chunking.fs
open System.Diagnostics
open Nessos.Streams
[<Struct; NoComparison; NoEquality>]
type Chunk<'T> =
[<DefaultValue false>] val mutable _toProcess : int
[<DefaultValue false>] val mutable _1 : 'T
[<DefaultValue false>] val mutable _2 : 'T
[<DefaultValue false>] val mutable _3 : 'T
[<DefaultValue false>] val mutable _4 : 'T