Skip to content

Commit

Permalink
Add benchmark for pocof event loop using dictionary input.
Browse files Browse the repository at this point in the history
  • Loading branch information
krymtkts committed Jan 24, 2025
1 parent 742330d commit c584e36
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/pocof.Benchmark/Benchmarks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -292,3 +292,21 @@ type PocofBenchmarks2() =
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

[<Benchmark>]
member __.interact_dict() =
let rui = new MockRawUI(60, 30, __.Keys)

let config: InternalConfig =
{ NotInteractive = true
Layout = Layout.TopDown
Keymaps = Keys.defaultKeymap
WordDelimiters = ";:,.[]{}()/\\|!?^&*-=+'\"–—―"
Prompt = prompt
PromptLength = prompt |> String.length
Properties = []
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

0 comments on commit c584e36

Please sign in to comment.