Skip to content

TypedPython: exact-type dict[str, int] and str fast path (wordfreq) #150

Closed

Description

@b-re-w

Approved by the user (2026-10-04). wordfreq is 1.1x: dict and str stay opaque objects. Add a path for exact dict with exact str keys and exact int values that calls the same C API (PyDict_GetItem/SetItem, str methods) directly, so no user hash/eq can run and results equal CPython's; anything not exact takes the existing object path.

Done when: differential tests (including str subclasses and int subclasses falling back), and wordfreq re-measured.

Activity

  1. b-re-w commented on Oct 17, 2026

    @b-re-w
    MemberAuthor

    Landed in develop via #253: the operations and exact dict/str fast paths are in, results identical to CPython. The wordfreq speedup is blocked on #232 (object-mode ints lose to CPython 3.15's specialising interpreter); a cost rule prevents the regression meanwhile.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions