Skip to content

Commit d450b65

Browse files
committed
Trying to benchmark the logging with a log open and visible
1 parent 42525eb commit d450b65

File tree

4 files changed

+31
-19
lines changed

4 files changed

+31
-19
lines changed

fnl/conjure-benchmark/log.fnl

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,24 @@
1212
"And yet another one."])
1313

1414
(fn setup []
15-
(set vim.o.filetype "fennel"))
15+
(log.close-visible)
16+
(vim.cmd "edit foo.fnl")
17+
(log.vsplit))
1618

1719
(set
1820
M.tasks
1921
[{:name "one logging call at a time"
20-
:task-fn (fn []
21-
(setup)
22-
(log.append lines))}
23-
{:name "30 log calls in a row"
22+
:before-fn setup
23+
:task-fn
24+
(fn []
25+
(log.append lines))}
26+
27+
{:name "50 log calls in a row"
2428
:iterations 100
25-
:task-fn (fn []
26-
(for [_i 1 30 1]
27-
(setup)
28-
(log.append lines)))}])
29+
:before-fn setup
30+
:task-fn
31+
(fn []
32+
(for [_i 1 50 1]
33+
(log.append lines)))}])
2934

3035
M

fnl/conjure-benchmark/run.fnl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
(local core (require :conjure.nfnl.core))
99
(local default-iterations 1000)
1010

11-
(fn benchmark-task [{: name : task-fn : iterations}]
11+
(fn benchmark-task [{: name : task-fn : iterations : before-fn}]
12+
(when before-fn
13+
(before-fn))
14+
1215
(let [start (vim.uv.now)
1316
iterations (or iterations default-iterations)]
1417
(for [_i 1 iterations]

lua/conjure-benchmark/log.lua

Lines changed: 5 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lua/conjure-benchmark/run.lua

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)