Skip to content

Commit

Permalink
Refine.
Browse files Browse the repository at this point in the history
  • Loading branch information
krymtkts committed Jan 25, 2025
1 parent c584e36 commit 9c4416d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/pocof.Benchmark/Benchmarks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ type QueryBenchmarks() =
Query.run __.PropertyContext __.Dicts props

[<MemoryDiagnoser>]
type PocofBenchmarks2() =
type PocofInteractBenchmarks() =
let prompt = ">"

let state: InternalState =
Expand All @@ -235,8 +235,6 @@ type PocofBenchmarks2() =

let publishEvent _ = ()

let consumer = new Consumer()

[<Params(10, 100, 1000)>]
member val EntryCount = 0 with get, set

Expand Down Expand Up @@ -290,8 +288,8 @@ type PocofBenchmarks2() =
PropertiesMap = Map [] }

use buff = Screen.init (fun _ -> rui) (fun _ -> Seq.empty) config.Layout prompt
// TODO: is Consumer.Consume the right way for this benchmark?
Pocof.interact config state buff publishEvent __.Objects |> consumer.Consume
// NOTE: use Seq.length to force strict evaluation of the sequence
Pocof.interact config state buff publishEvent __.Objects |> Seq.length |> ignore

[<Benchmark>]
member __.interact_dict() =
Expand All @@ -308,5 +306,5 @@ type PocofBenchmarks2() =
PropertiesMap = Map [] }

use buff = Screen.init (fun _ -> rui) (fun _ -> Seq.empty) config.Layout prompt
// TODO: is Consumer.Consume the right way for this benchmark?
Pocof.interact config state buff publishEvent __.Dicts |> consumer.Consume
// NOTE: use Seq.length to force strict evaluation of the sequence
Pocof.interact config state buff publishEvent __.Dicts |> Seq.length |> ignore

0 comments on commit 9c4416d

Please sign in to comment.