<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lectio.git/mobile/mobile_test.go, branch perf/hoist-date-independent-work</title>
<subtitle>offline Catholic daily readings and liturgical calendar in Go, with CLI, TUI and web clients</subtitle>
<id>https://git.labunix.xyz/lectio.git/atom?h=perf%2Fhoist-date-independent-work</id>
<link rel='self' href='https://git.labunix.xyz/lectio.git/atom?h=perf%2Fhoist-date-independent-work'/>
<link rel='alternate' type='text/html' href='https://git.labunix.xyz/lectio.git/'/>
<updated>2026-08-24T14:35:01Z</updated>
<entry>
<title>perf(readings): stack calendar layers and load the book table once per Days call</title>
<updated>2026-08-24T14:35:01Z</updated>
<author>
<name>Lukasz Kasprzak</name>
<email>lukas@labunix.xyz</email>
</author>
<published>2026-08-24T14:35:01Z</published>
<link rel='alternate' type='text/html' href='https://git.labunix.xyz/lectio.git/commit/?id=b6ee8f09ad2c0bc9e83394e2427de861eb1e2a72'/>
<id>urn:sha1:b6ee8f09ad2c0bc9e83394e2427de861eb1e2a72</id>
<content type='text'>
mobile.Days (dlectio's 7-day calendar view) called readings.Load once per
date. Load's offlineLoad re-ran caldata.Stack (parses the embedded
calendar INI, plus any user calendar layer) and bible.LoadBookTable
(parses the embedded books.ini, plus any user override) on every call,
even though neither depends on the date -- only on cfg.Selection().Form
and cfg.Use, which mobile.Days holds fixed across its whole loop.

Verified before changing anything: isolated benchmarks put Stack+
LoadBookTable at ~1.1ms/call (OF) and ~1.6ms/call (EF) -- real INI
parsing and, for a user override, file I/O -- and for the OF form that
redundant work was ~67% of a 7-day view's total time.

Load gains a Prepared value (the layer stack + book table) and a
Prepare/LoadWith pair: Prepare builds a Prepared once, LoadWith reuses
it across dates. Load itself is unchanged, still calling Prepare on
every invocation -- every existing caller keeps its current behaviour
untouched. mobile.Days now Prepares once and loops LoadWith; mobile.Day
picks up the same fix for its own two same-cfg Load calls.

Benchmarked (interleaved before/after pairs, to control for machine
thermal drift): the OF 7-day view (BenchmarkDaysWeek) drops from
~11.5ms to ~6.4ms/op (allocs 53359 -&gt; 16347, -69%), an EF 7-day view
(BenchmarkDays7EF) from ~74ms to ~66-73ms/op (allocs 299204 -&gt; 253815,
-15%; the EF form's per-day calendar computation dominates its total
cost far more than OF's does, so the fix's share of the win is smaller
there), and a single Day call (BenchmarkDay1) from ~4.3ms to ~2.9ms/op
(allocs 15357 -&gt; 9192, -40%).

Output identity verified separately (not part of this diff): a 288-case
sweep of mobile.Day/mobile.Days across both forms, both UI languages,
all four corpora, a leap day, the Sacred Triduum, a Requiem day, and
windows spanning Christmas/Pentecost/Assumption/All Souls produced
byte-identical (SHA-256-equal) JSON before and after this change.

New TestLoadWithAgreesWithLoad asserts LoadWith(Prepare(cfg), cfg, opts)
equals Load(cfg, opts) for every case, so the fast path cannot silently
drift from the slow one. go test ./... and make ci (both build tags,
oracle/differential suite included) are green.
</content>
</entry>
<entry>
<title>readings: PartIDs(new) stops declaring aklamacja, which the engine never emits</title>
<updated>2026-08-05T12:10:34Z</updated>
<author>
<name>Lukasz Kasprzak</name>
<email>lukas@labunix.xyz</email>
</author>
<published>2026-08-05T12:10:34Z</published>
<link rel='alternate' type='text/html' href='https://git.labunix.xyz/lectio.git/commit/?id=eb4a02205f5b3b972c44b854d5becbbd0b522981'/>
<id>urn:sha1:eb4a02205f5b3b972c44b854d5becbbd0b522981</id>
<content type='text'>
caldata.go:42 parses only first/psalm/second/gospel out of the lectionary
data, so no OF reading ever carries Part == "acclamation". PartIDs("new")
listed aklamacja anyway, so the app built a checkbox from it that filters
an ID that never appears -- a dead control, same defect class the app
previously shipped for the whole 1962 form.

ofPartOrder stays the full five-ID set: it also drives
render.LocalizeHeading's label matching, where a scraped heading can still
read "Aklamacja" even though this engine's own readings never produce
that section. PartIDs now draws from a new, narrower
ofEmittedPartOrder instead.

Rewrote TestPartLabelsMatchesWhatTheEngineEmits's OF half: it compared
PartLabels("of") to a hand-copied duplicate of ofPartOrder, asserting a
declaration against itself, which cannot fail for this class of bug. It
now sweeps Days over calendar year 2026 and asserts PartLabels("of")
matches the observed part-ID set exactly (0.5s). Confirmed red against
the pre-fix code, green after.
</content>
</entry>
<entry>
<title>mobile: strengthen the PartLabels fallback test and count bounds</title>
<updated>2026-08-03T22:11:23Z</updated>
<author>
<name>Lukasz Kasprzak</name>
<email>lukas@labunix.xyz</email>
</author>
<published>2026-08-03T22:11:23Z</published>
<link rel='alternate' type='text/html' href='https://git.labunix.xyz/lectio.git/commit/?id=197ce6980daa1c3773eed1548f54861d616d35e4'/>
<id>urn:sha1:197ce6980daa1c3773eed1548f54861d616d35e4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>mobile: add PartLabels so the app stops hardcoding part IDs</title>
<updated>2026-08-03T21:59:50Z</updated>
<author>
<name>Lukasz Kasprzak</name>
<email>lukas@labunix.xyz</email>
</author>
<published>2026-08-03T21:59:50Z</published>
<link rel='alternate' type='text/html' href='https://git.labunix.xyz/lectio.git/commit/?id=1106568c52265ea3076b9d3f1943c052c83a2a89'/>
<id>urn:sha1:1106568c52265ea3076b9d3f1943c052c83a2a89</id>
<content type='text'>
</content>
</entry>
<entry>
<title>mobile: add Days, a text-free week projection for the calendar</title>
<updated>2026-08-03T21:59:09Z</updated>
<author>
<name>Lukasz Kasprzak</name>
<email>lukas@labunix.xyz</email>
</author>
<published>2026-08-03T21:59:09Z</published>
<link rel='alternate' type='text/html' href='https://git.labunix.xyz/lectio.git/commit/?id=27ceffcb90c0716179342109163c559d492a8abc'/>
<id>urn:sha1:27ceffcb90c0716179342109163c559d492a8abc</id>
<content type='text'>
A week through Days benchmarks at ~9-10ms/op, versus ~23ms for seven
full days through Day.
</content>
</entry>
<entry>
<title>mobile: return the day's rank and its localised label</title>
<updated>2026-08-03T21:56:14Z</updated>
<author>
<name>Lukasz Kasprzak</name>
<email>lukas@labunix.xyz</email>
</author>
<published>2026-08-03T21:56:14Z</published>
<link rel='alternate' type='text/html' href='https://git.labunix.xyz/lectio.git/commit/?id=13d5e99ab90ab872c8cc072a0246348f0d24fa9a'/>
<id>urn:sha1:13d5e99ab90ab872c8cc072a0246348f0d24fa9a</id>
<content type='text'>
</content>
</entry>
</feed>
