Skip to content

Symbol tables should keep internal properties separate #16868

Closed

Description

Right now symbol tables store things like __call and __construct alongside user-provided symbols. This forces us to mangle/unmangle symbols that start with two underscores. Instead, symbol tables should keep a map of user-provided symbols as before, but also provide optional properties for internals like __call et al.

When the symbol() type becomes available, the symbol table should also include an "dynamic names" map in addition to the "user-provided names" map.

Activity

  1. ahejlsberg commented on Jul 3, 2017

    @ahejlsberg
    Member

    In principle I agree, but the challenge here is to make a new representation not consume more memory. We allocate an awful lot of symbol tables (many of them very small), and we wouldn't want to double that number. The advantage of the current representation is that we can put it all in a single map.

  2. added
    UnactionableThere isn't something we can do with this issue
    and removed
    Needs InvestigationThis issue needs a team member to investigate its status.
    on Sep 16, 2019
  3. RyanCavanaugh commented on Sep 16, 2019

    @RyanCavanaugh
    Member

    Would welcome a PR that shows substantive perf improvement here (seems like the cognitive penalty is reasonably low), but either way this is speculative.

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

    UnactionableThere isn't something we can do with this issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions