BlyxDocumentation
Browse chapters
Documentation / Workflow recipes

Pelican · Compare merged reads with aligned per-request reads

Compare per-request aligned I/O with coalesced unaligned reads for a sorted trace.

Compare merged reads with aligned per-request reads

Merging requests saves seeks but can read unused gap bytes. Report each cost explicitly before changing a storage access pattern. The example's two merged ranges fetch ten bytes including a one-byte gap. Independent eight-byte-aligned reads would fetch 24.

Run the framework with your own input

Install Blyx 0.2.1 and a Rust toolchain with a host linker, then run the versioned project. Each positional argument is a number or a comma-separated numerical vector. The CLI accepts up to 16 entries per vector. The imported module accepts longer inputs.

git clone --depth 1 --branch v0.1.0 https://github.com/Rahulchaube1/blyx-pelican.git
cd blyx-pelican
blyxc native-run project.blyx -- "0,5,20" "4,3,2" 1 8

API and return values

Returns [independent aligned bytes, coalesced read count, coalesced bytes, bridge-gap bytes]. Values describe two explicitly defined read strategies. Invalid input returns an empty vector.

ArgumentAccepted input
startsVector of: nonnegative exact integer
lengthsVector of: positive exact integer
gapnonnegative exact integer
blockpositive exact integer

Use the libraries independently

The framework vendors the same library source published in these two repositories. Each module has its own package page, input contract and regression suite.

Try the program

Output Ready
Expected output
24
2
10
1
Open in the full playground →

Practice

Change starts = [], lengths = [], gap = 0.0, block = 4.0. Predict the result, then run the program.

Hint

Returns [independent aligned bytes, coalesced read count, coalesced bytes, bridge-gap bytes]. Values describe two explicitly defined read strategies.

Worked solution

The result vector is [0, 0, 0, 0]. Compare its fields with the return layout in the API section.

Find

    let starts = [0, 5, 20];

Replace with

    let starts = [];

Find

    let lengths = [4, 3, 2];

Replace with

    let lengths = [];

Find

    let gap = 1.0;

Replace with

    let gap = 0.0;

Find

    let block = 8.0;

Replace with

    let block = 4.0;

Output after the change

0
0
0
0