Skip to content

Decode images without blocking the caller and within a stated memory budget #50

Description

@iderex

Decoding is the part of artwork that costs real time, and it is the part that
most easily lands on the thread a client draws with. The concurrency record in #9
promised which calls may block. This is where that promise is kept or broken for
the most expensive operation in the repository.

Memory is the other half. Two hundred decoded tiles held at once is enough to be
killed by the operating system on a television, and that failure looks like a
crash rather than like a cache that was too large.

What this produces

Decoding that never runs on the caller's thread, matching the guarantee in #9.

A bound on how many decodes run at once, with a stated default and its reason,
since unbounded parallel decode on a four-core television is slower than a bounded
one as well as heavier.

A bound on decoded bytes held, separate from the byte cache in #54, because
decoded images and stored bytes have very different costs.

Decoding handed to the platform where the platform has a better decoder, through
an interface, with a core implementation as the fallback.

Done when

A test proves the caller's thread is not used for decode. A test drives 200
images through and proves the decoded-bytes bound holds throughout. Both run
headless. Blocked on #9.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

architectureShape of the core: boundaries, interfaces, contractsblocked-on-dependencyWaiting on another issue or on a state of the tree, not on a personperformanceThe speed budget and what measures it

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions