Skip to main content
Because most builds/actions only touch a fraction of a repo’s files — typically under 30% as per our analysis of the top 100 GH repos — mesa loads your repository lazily rather than waiting for a full download. It materializes files as you use them, fetching only what you’re likely to need.

Layout BFS Prefetching

Breadth-first layout prefetching works by downloading the listing of each directory, one layer lower than your current directory. As you visit /foo, we try to fetch the listing of /foo/bar and /foo/baz, but not /foo/bar/qux.

Content BFS Prefetching

This mode is currently in development and is not released. If you need it soon, do not hesitate to reach out to us.
As well as prefetching the file tree layout, mesa supports prefetching the file content. Similarly to layout BFS prefetching, we prefetch files one-layer ahead of your current activity.

Configurable Prefetching

This mode is currently in development and is not released. If you need it soon, do not hesitate to reach out to us.
mesa can be configured to allow you tweak which part of the file tree you wish it to prefetch first. Adding the following to your config.toml:
[organizations.cyberdyne.skynet.prefetch]
"/core/consciousness" = { mode = "dfs" }
"/hardware/terminators" = { mode = "bfs", max-levels = 1 }
"*" = { mode = "bfs", max-levels = 1 }
results in mesa pre-fetching all of /core/consciousness, in a depth-first manner, followed by fetching only one level of the /hardware/terminators directory and then breadth-first prefetching everything as you lookup files/directories. The ordering of the entries controls the prefetch rule priority. To continue the example, after the first pre-fetching pass is complete, you would end up with the following cached:
.
├── core/
│   ├── consciousness/ <- unbounded DFS of this directory causes `mesa` to prefetch it first
│   │   ├── threat-models/
│   │   │   ├── humans/
│   │   │   │   └── model.ai
│   │   │   └── animals/
│   │   │       └── model.ai
│   │   └── self-awareness.ai
│   └── decision-engine/ <- got fetched because we needed the listing of core/ in order to get /core/consciousness
│                           none of its children are pre-fetched.
└── hardware/
    └── terminators/
        ├── t400/
        │   ├── data/ <- nothing in data/ is pre-fetched, until you run lookup(/hardware/terminators/t400)
        │   │            because of the max-levels limit
        │   ├── t400.kicad_pcb
        │   ├── t400.kicad_sch
        │   └── t400.kicad_pro
        ├── t800/
        │   ├── data/
        │   ├── t800.kicad_pro
        │   ├── t800.kicad_sch
        │   └── t800.kicad_pcb
        └── README.md