Skip to content

Native register ABI regresses generated-code throughput ~5-10x (MKDD 51 -> 10 fps) #24

Description

@dougchansan

1bec355 ("improve llvm backend") and 0137523 ("Add native register ABI") incorporate the changes from #21, #22 and #23 -- thanks for folding those in. Measuring current main against the PR branches on the same runtime build and pinned savestates, though, shows a large performance regression:

title / scene PR #23 branch current main runtime
Mario Kart DD, bench.sav, capped 51.0 fps 10.0 fps same binary
Colosseum, Phenac scene, capped 25-29 fps 2.4 fps (vps 4.9) same binary

Counters for the Colosseum runs show the same per-cycle hook-fallback rate on both builds, but guest throughput collapses ~12x on main (1.09G cycles retired vs 13.3G in an equal window), so the cost is in the generated code itself rather than in fallback traffic. The native ABI applies automatically per function via nativeABIFlags() with no opt-out flag, so there is no way to A/B it from a built module -- an env or CLI gate would make this easy to bisect.

Setup notes for reproducing: Windows x86-64, clang toolchain modules, runtime with ExpansionPak/RecompCore#18 applied (that PR is the delivery half of #23's fix -- without it the mtmsr exit in emitStateWrite creates the boundary but pending external interrupts still wait for slice granularity, and Colosseum's retrace wait starves back to ~0.25 fps).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions