Experiment 036: Compiler Hints (Dart + C)

Date: 2026-04-09

Status: Accepted

Changes

Dart:

C:

json_write_string, write_json_to_buf, resqlite_step_row, fast_i64_to_str

resqlite_step_row exit check (unlikely)

Results

No isolated signal โ€” these are compiler optimization hints that affect code

generation quality. The Dart pragma primarily helps AOT (Flutter release builds)

rather than JIT benchmarks.

Decision

Accepted โ€” zero-risk annotations. No behavioral changes. The __restrict

qualifier helps the C compiler eliminate redundant loads in the JSON buffer

write path. The __builtin_expect hints align branch prediction with the

actual hot path (buffer has capacity, step returns SQLITE_ROW).