Skip to content

Pitfall: code placement decides speed in the 1-way I-cache (Core 12870) - #99

Open
WDrijver wants to merge 2 commits into
mainfrom
pitfall/icache-code-placement
Open

WDrijver wants to merge 2 commits into
mainfrom
pitfall/icache-code-placement

Conversation

@WDrijver

Copy link
Copy Markdown
Contributor

A new pitfall: on Core 12870 the I-cache is 32 KB and direct-mapped (1-way, 64-byte lines; Willem, 2026-11-26), so where code lands decides its speed. In ApolloOS-Port this showed as:

  • RectFill 10x10 gaining 58 % cycles at the same instruction count after an unrelated change;
  • AllocMem getting 1.6x faster from 1 KB of padding that never runs.

The page covers:

  • the symptom and the cause, including the library jump tables in RAM, which take part too;
  • the wrong practice (single before/after benchmarks) and the right one: placing hot code on purpose, keeping rom_init right after the ROM header for ColdReboot, and judging changes by IEP and CCC together;
  • detection, and the measured evidence.

Status: draft.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@WDrijver
WDrijver requested a review from TuKo1982 as a code owner November 27, 2026 11:17
…t Text 15 % (Core 12870)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant