Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

LOAD_FAST_BORROW not being used even when safe to do so, if value is live at BB end. #133672

Open
Labels
3.15new features, bugs and security fixesperformancePerformance or resource usage
@markshannon

Description

@markshannon

This function

def f(x, y, c):    return 1 + (x if c else y)

compiles to

  1           RESUME                   0  2           LOAD_SMALL_INT           1              LOAD_FAST_BORROW         2 (c)              TO_BOOL              POP_JUMP_IF_FALSE        9 (to L1)              NOT_TAKEN              LOAD_FAST_BORROW         0 (x)              BINARY_OP                0 (+)              RETURN_VALUE      L1:     LOAD_FAST                1 (y)              BINARY_OP                0 (+)              RETURN_VALUE

Note that the load ofy usesLOAD_FAST even thoughLOAD_FAST_BORROW is safe.

This becomes important withvirtual iterators as the iterable for the loop is live at BB end.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.15new features, bugs and security fixesperformancePerformance or resource usage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp