Skip to main content

Module cache

Module cache 

Source
Expand description

What one package keeps between two calculations - so that a face which recomputes (the front end, on every change of trace or selection) reads each object once.

The calculation can exploit the optimisations the front end already caches, so as not to recompute what the front end already has. The front end’s own caches - its package index, its colour walks - come in through crate::read::PackageContext; this is the section’s own, kept by the face next to the package (one per package, as the wasm Session is).

§What depends on what

keptdepends onso a change of trace…
a well, read (WellRead)the package, the scene’s systemreads nothing again: wells are projected in assemble
a surface, placed (Prepared)the package, the scene’s systemreads nothing again
a surface’s cut along one linethe above and that line (its polyline, nothing else)cuts only the lines it has not cut: another section, a cut; a width, a key, an order, none
a well’s head (HeadSlot) and the spatial index over the headsthe package, the scene’s systemreads nothing again: the sections only choose which wells to read

The package is told by its revision (Asked::revision, the store’s): another revision, another store id or another scene and everything is dropped - a stale well is a well drawn where the file no longer puts it. A cut depends on the line and on nothing else of the section - not its corridor, not its key, not the other sections - so it is kept under (surface, line), several per surface (ADR-0010), and going A → B → A cuts nothing the third time. A line the surface misses is kept too: it is an answer. What is kept carries no section key; the key of the section asking is written on it when it is served.

Only what read is kept: a refusal is said again, never remembered (the rule of the wasm PieceCache), so a backend loaded since can answer.

Work counts what was done, so the tests count work and never time (energyml-domain’s color_scopes does the same).

Structs§

PackageCache
One package’s reads, kept - see the module.
Work
What a calculation did, summed since the cache was made.