Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Be able to bail out to deoptimized code #214

@DemiMarie

Description

@DemiMarie

Consider this function:

def simple_func(a, b, c):
    if a > b:
        return b if b > c else c
    else:
        return 0

To get good performance, we want to generate code that operates on machine integers, not Python objects. That means that we must:

  • Profile and record that (as is likely here) a, b, and c are all integers normally.
  • Generate optimized machine code that
    • tests that a, b, and c are machine integers
    • if not, bail out to the interpreter and deoptimize the generated code
    • otherwise, use the optimized machine code.

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