Skip to content

gh-145742: Manually emit _LOAD_FAST_BORROW to reduce stencil bloat#148217

Open
corona10 wants to merge 1 commit intopython:mainfrom
corona10:gh-145742-impl
Open

gh-145742: Manually emit _LOAD_FAST_BORROW to reduce stencil bloat#148217
corona10 wants to merge 1 commit intopython:mainfrom
corona10:gh-145742-impl

Conversation

@corona10
Copy link
Copy Markdown
Member

@corona10 corona10 commented Apr 7, 2026

  • Manually emit _LOAD_FAST_BORROW at JIT compile time, encoding the operand offset directly into the instruction instead of loading it from the GOT at runtime.
  • This shrinks the generic case (oparg ≥ 8) from 28 bytes to 8 bytes and eliminates 27 stencil functions.
  • I've compared machine code through godbolt: https://godbolt.org/z/3M9zKeosj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant