<feed xmlns='http://www.w3.org/2005/Atom'>
<title>xmobar/bench, branch 0.45</title>
<subtitle>a minimalistic status bar</subtitle>
<id>https://jao.io/cgit/xmobar/atom?h=0.45</id>
<link rel='self' href='https://jao.io/cgit/xmobar/atom?h=0.45'/>
<link rel='alternate' type='text/html' href='https://jao.io/cgit/xmobar/'/>
<updated>2020-11-13T02:10:31Z</updated>
<entry>
<title>Optimize Date plugin again (refresh timezone only once a minute)</title>
<updated>2020-11-13T02:10:31Z</updated>
<author>
<name>Tomas Janousek</name>
<email>tomi@nomi.cz</email>
</author>
<published>2020-11-12T10:02:44Z</published>
<link rel='alternate' type='text/html' href='https://jao.io/cgit/xmobar/commit/?id=17b0dac481c01425651326e8814b45058cd40f06'/>
<id>urn:sha1:17b0dac481c01425651326e8814b45058cd40f06</id>
<content type='text'>
This makes the Date plugin approximately twice as fast, and makes xmobar
up to about 5–10 % faster if Date is the only active plugin. (If more
expensive plugins like Network or MultiCpu are used, it doesn't make any
measurable difference.)

Micro-benchmark results on my HW:

    Date Benchmarks/Date                     mean 2.833 μs  ( +- 16.08 ns  )
    Date Benchmarks/DateZonedTime            mean 5.020 μs  ( +- 32.91 ns  )
    Date Benchmarks/DateWithTimeZone         mean 2.827 μs  ( +- 20.52 ns  )

(DateZonedTime is the original implementation and DateWithTimeZone is
the implementation we had since 0.34 which never refreshes timezone.)

Real-life measurements (done overnight on an idle laptop, with all
measured xmobars running in parallel to ensure comparable conditions;
xmobars configured to only display date and with rate 10 — once per
second):

    $ time timeout 6h xmobar .xmobarrc-DateZonedTime
    real    360m0,010s
    user    0m9,867s
    sys     0m4,644s

    (9.867 + 4.644) / (360 * 60) = 0.000672

    $ time timeout 6h xmobar .xmobarrc-Date
    real    360m0,008s
    user    0m9,535s
    sys     0m4,327s

    (9.535 + 4.327) / (360 * 60) = 0.000642

    $ time timeout 6h xmobar .xmobarrc-Date-10m
    real    360m0,010s
    user    0m9,780s
    sys     0m4,215s

    (9.780 + 4.215) / (360 * 60) = 0.000648

    $ time timeout 6h xmobar .xmobarrc-DateWithTimeZone
    real    360m0,006s
    user    0m9,658s
    sys     0m4,166s

    (9.658 + 4.166) / (360 * 60) = 0.000640

(.xmobarrc-Date-10m is the proposed implementation, but with timezone
refresh every 10 minutes instead of every 1 minute)

Interpretation of these results:

 * refreshing xmobar with just date takes around 650 μs
 * that is xmobar with just date uses around 0.065 % of CPU time
 * refreshing timezone takes additional cca 30 μs

When we only refresh timezone once a minute, these 30 μs become 0.5 μs
amortized, and that should be acceptable to even the most dedicated
perfectionist :-)

Fixes: a58e32f7c8af ("Revert "Optimize date plugin"")
Fixes: 878db3908060 ("Optimize date plugin")
Co-authored-by: Sibi Prabakaran &lt;sibi@psibi.in&gt;
</content>
</entry>
<entry>
<title>bench: Clean up a bit</title>
<updated>2020-11-13T02:10:31Z</updated>
<author>
<name>Tomas Janousek</name>
<email>tomi@nomi.cz</email>
</author>
<published>2020-11-12T09:33:25Z</published>
<link rel='alternate' type='text/html' href='https://jao.io/cgit/xmobar/commit/?id=e47cb0222eb5b152f69a18f4685726a5460f4b90'/>
<id>urn:sha1:e47cb0222eb5b152f69a18f4685726a5460f4b90</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Optimize CPU monitor</title>
<updated>2020-06-23T15:38:20Z</updated>
<author>
<name>Sibi Prabakaran</name>
<email>sibi@psibi.in</email>
</author>
<published>2020-06-14T04:16:47Z</published>
<link rel='alternate' type='text/html' href='https://jao.io/cgit/xmobar/commit/?id=b4f0f35ef118064bc7829b6224a896b448a37bc4'/>
<id>urn:sha1:b4f0f35ef118064bc7829b6224a896b448a37bc4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Initial support for benchmarks of the plugins</title>
<updated>2020-06-13T09:22:36Z</updated>
<author>
<name>Sibi Prabakaran</name>
<email>sibi@psibi.in</email>
</author>
<published>2020-06-13T09:22:36Z</published>
<link rel='alternate' type='text/html' href='https://jao.io/cgit/xmobar/commit/?id=2ae720ab47213d93ffd22a40cd99b80bec1d022a'/>
<id>urn:sha1:2ae720ab47213d93ffd22a40cd99b80bec1d022a</id>
<content type='text'>
</content>
</entry>
</feed>
