Skip to content

Consider whether to default short-ranged fixnums to ShortFixnum #9422

Description

@headius

In #9379 (comment) I discuss some benchmark findings that show ShortFixnum's constantly widening and narrowing of values impacts the performance of short-ranged loops. This overhead is not enormous on Java 25 (35-40% slower) but on implementations like Java 26 and GraalVM that have better escape analysis the difference can be very large (170% slower on 26, 20x slower on GraalVM).

At the same time, ShortFixnum provides substantial size reductions, so it's a tough call whether to keep the size improvement or prefer the numeric algorithm performance.

We should consider which default is better for users and make sure the alternative is well-documented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions