Skip to content

Use instruction offset, not byte offset, in bytecodes. #34

Closed
@markshannon

Description

@markshannon

All offsets, for jumps, in the bytecode are by bytes, not by instructions. Effectively this limits the range of jumps not needing EXTENDED_ARG to 128 instructions. Using instruction offsets would increase the range to 256.

Analysis of jumps in standard library by operand:

The part of the standard library has been compiled after running the tests:

<256 131814 88.1%
256-511 12269 8.2%
512+ 5602 3.7%
Total 149685

Just top level modules:

<256 41077 83.2%
256-511 5308 10.7%
512+ 2995 6.1%
Total 49380

So it would appear that roughly 8-10% of branches would benefit from instruction, rather than byte, offsets.

Metadata

Metadata

Assignees

Labels

3.10Things we could safely do for 3.10

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions