Skip to main content

13 posts tagged with "performance"

View All Tags

An effect as a literal, driven by one service

· 5 min read

An effect used to be a class instance that carried its own state and its own methods. It is now a plain object literal, and every effect on a channel is driven by one long-lived OIMEffectService. Two recorded pieces price the shape itself: with the hidden-class loss at a full GC held out, the class was 1.15–1.17× dearer to create and within a few percent of the literal on wake and dispose.

One map or two: where the row lives

· 5 min read

A keyed store can keep a row and its identity together — one Map<key, slot>, the row on the slot — or apart: a Map<key, row> for the data and a second Map<key, slot> whose identities are minted only when something needs one. Apart is the cheaper first load. It is dearer on every write once anything is watching, and dearer by 3.5× when a subscription asks for an identity.

Pull or push, measured at three depths

· 5 min read

A derivation finds out it is stale either because the read asks its sources, or because the write already marked it. OIMDB asks at the read. One recorded piece puts both against each other at chain depths 1, 2 and 3, with everything else held still: the read-side check is 1.67× cheaper at depth 1, the two are inside the instrument's error at depth 2, and the write-side mark is 1.70× cheaper at depth 3.

Subscribing to the identity, and what it costs to leave

· 6 min read

An effect in this engine subscribes to the slot it was handed; the 3.12.1 engine subscribed a handler under a key. Three pieces recorded on one evening put the two side by side on the wake and on the mount-and-release cycle. The wake went to the slot subscription in all three. The mount-and-release cycle went against it until the detach stopped searching for itself, and then came out 1.13× cheaper.

When a computed pays for itself

· 5 min read

A computed caches a derivation so that reads between two writes do not repeat it. It also costs something to hold. One recorded piece prices a computed against calling the same function in the consumer's body, along two axes — how dear the body is, and how many reads fall between two writes — and the answer depends on both: 21.4× cheaper for a 128-row walk read sixty-four times per write, 2.50× dearer for a one-field body read eight times.

Where an index keeps the key a row was filed under

· 4 min read

When a row is written, an index has to know which bucket the row was in before, so it can tell whether the row moved. OIMDB keeps that previous answer in a cell on the row's own slot. One recorded piece prices it against the two alternatives — recalling it from a Map keyed by the row, and recomputing and diffing through a pair of Sets — at 1.61× and 2.67× cheaper per row per write.