Skip to content

Optimize interpreter with computed gotos #1919

Open
@mateofio

Description

@mateofio

This is a non standard language feature implemented on all compilers except Microsoft.

  • Merge all 3 ExecuteCommand methods into 1
  • Reimplement the switch using computed goto and measure the performance gain.
  • Provide a fallback for MSVC

https://youtu.be/IAdLwUXRUvg
Around the 41 minute mark

The speaker claims a 10-20% speed in improvement in Lua and Python interpreters using this technique.

This could result in 10-40% speedup in Player interpreter execution. It may be especially meaningful in resource constrained platforms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BuildingEvent/InterpreterPerformanceRelated to improvements on memory, less CPU or disk usage, battery savings, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions