<commit_before>﻿// Prime - A PRIMitivEs code library.
// Copyright (C) <NAME>, 2012-2016.

namespace Prime
open System
open System.Collections.Generic
open System.Diagnostics
open Prime
open Prime.Tests
module Program =

    /// Performs some ad-hoc tests to compare performance of maps.
    let runTimings make lookup name =
        printfn "%s timings..." name
        let rand = Random 1
        let entries = [|for _ in 0 .. 524280 do yield (let n = rand.Next () in (string n, (string n, string n)))|]
        for _ in 0 .. 4 do
            GC.Collect ()
            let watch = Stopwatch.StartNew ()
            let made = make entries
            watch.Stop ()
            GC.Collect ()
            let watch2 = Stopwatch.StartNew ()
            lookup entries made
            watch2.Stop ()
            printfn "Make time: %A\tLookup time: %A" watch.Elapsed watch2.Elapsed

    /// Run timings.
    /// NOTE: even if this timing functionality is cleared out, the main entry point must remain in tact due to -
    /// https://github.com/Microsoft/visualfsharp/issues/1371#issuecomment-235101700
    let [<EntryPoint; STAThread>] main _ =

        EventTests.subscribeWorks ()

        // run map timings
        runTimings<commit_msg>Code clean up.<commit_after>﻿// Prime - A PRIMitivEs code library.
// Copyright (C) <NAME>, 2012-2016.

namespace Prime
open System
open System.Collections.Generic
open System.Diagnostics
open Prime
open Prime.Tests
module Program =

    /// Performs some ad-hoc tests to compare performance of maps.
    let runTimings make lookup name =
        printfn "%s timings..." name
        let rand = Random 1
        let entries = [|for _ in 0 .. 524280 do yield (let n = rand.Next () in (string n, (string n, string n)))|]
        for _ in 0 .. 4 do
            GC.Collect ()
            let watch = Stopwatch.StartNew ()
            let made = make entries
            watch.Stop ()
            GC.Collect ()
            let watch2 = Stopwatch.StartNew ()
            lookup entries made
            watch2.Stop ()
            printfn "Make time: %A\tLookup time: %A" watch.Elapsed watch2.Elapsed

    /// Run timings.
    /// NOTE: even if this timing functionality is cleared out, the main entry point must remain in tact due to -
    /// https://github.com/Microsoft/visualfsharp/issues/1371#issuecomment-235101700
    let [<EntryPoint; STAThread>] main _ =

        // run map timings
        runTimings
{'fraction_non_alphanumeric': 0.09734151329243354, 'fraction_numerical': 0.027811860940695297, 'mean_word_length': 2.0651629072681703, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6409933', 'n_tokens_mistral': 729, 'n_tokens_neox': 664, 'n_words': 250}