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

Avoid ClassNode construction for classes that do not get instrumented #6152

Merged
merged 1 commit into from
Jan 16, 2021

Commits on Jan 16, 2021

  1. Avoid ClassNode construction for classes that do not get instrumented

    According to https://asm.ow2.io/performance.html, using a ClassReader is a lot
    faster for reading basic class metadata than creating a ClassNode. This is
    because to create a ClassNode, every single byte of the class file needs to be
    visited, including method instructions. For ClassReader, a lot of the work is
    done lazily. Previously, a ClassNode object was constructed for every class
    loaded by SandboxClassLoaer, regardless of whether or not it was instrumented.
    
    Instead, use a ClassReader approach to determine whether or not a class needs
    to be instrumented, and then build the ClassNode if it needs to be
    instrumented. This should improve performance for larger tests that load a lot
    of non-Android classes.
    
    PiperOrigin-RevId: 351251828
    hoisie committed Jan 16, 2021
    Configuration menu
    Copy the full SHA
    c2ebe87 View commit details
    Browse the repository at this point in the history