Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up registration of stack maps #2820

Closed

Commits on Apr 8, 2021

  1. Speed up registration of stack maps

    This commit fixes a perf issue I was seeing in some local benchmarking
    where registration of stack maps took a nontrivial amount of time for a
    module that didn't even use stack maps! The fix here is to largely just
    do the same thing as bytecodealliance#2811 which is to use the in-memory data structures
    of a `CompiledModule` rather than rebuilding different data structures
    when a module is registered with a `Store`.
    
    The `StackMapRegistry` type now takes a lookup object for a range of
    pcs, simplifying registration. Registration additionally doesn't even
    happen if a module is pre-determined to not have any stack maps inside
    of it. This trait object encapsulates all the logic that was previously
    used in the rebuilt data structures and also leverages conveniences like
    `CompiledModule::func_by_pc` added recently as well.
    
    With this all combined it means that modules which don't have stack maps
    now skip this registration step entirely and modules with stack maps
    should do much less work during registration as well.
    alexcrichton committed Apr 8, 2021
    Configuration menu
    Copy the full SHA
    9f1aa64 View commit details
    Browse the repository at this point in the history