Skip to content

Implement fast symbol lookup in the interpreter #5638

Closed

Description

@laurentlb

We talked about speeding up the interpreter by avoiding hash maps for variable lookup. We should be able to assign statically an integer to each variable.

Unfortunately, we can't do this safely right now because of a bug in the interpreter (#5637). In some cases, the name resolution is not static. Once the bug is fixed, that should be feasible.

cc @ttsugriy

Activity

  1. added
    P2
    and removed on Nov 21, 2018
  2. meisterT commented on May 16, 2020

    @meisterT
    Member

    I assume @alandonovan's work makes this obsolete?

  3. laurentlb commented on May 17, 2020

    @laurentlb
    ContributorAuthor

    I'd say it's part of Alan's work. You first need the static resolution before you can generate (decent) bytecode.

  4. alandonovan commented on May 17, 2020

    @alandonovan
    Contributor

    What Laurent said. The following changes are necessary first:

    • decouple thread from module (CL 309983907, in review)
    • add loadBindsGlobally option to resolver (will port go.starlark.net resolver)
    • make the prelude behave like a load statement (no shared syntax trees => recordScope always on) (CL 309105613, in progress)
    • use arrays for local variables (the actual optimization; it is trivial)
  5. brandjon commented on Feb 16, 2021

    @brandjon
    Member

    Alan implemented this some time ago.

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

Metadata

Metadata

Assignees

Labels

P2type: feature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions