Skip to content
  • etiennep's avatar
    Courgette: Add static method QuickDetect() to optimize program detection. · 5059bca6
    etiennep authored
    Old way: The detection of executables is achieve by allocating an instance of each
    Disassembler classes and trying to call ParseHeader() to see if it succeed.
    This operation is done many times during FindEmbeddedElements() step,
    which takes ~4% of patch generation time.
    New way: Using QuickDetect(), which executes only a quick preliminary check,
    we avoid useless allocation of Disassembler objects unless
    there's a high probability of successfully detecting a valid executable.
    This change reduces the execution time of FindEmbeddedElements() by 95%.
    
    BUG=619167
    
    Review-Url: https://codereview.chromium.org/2055343002
    Cr-Commit-Position: refs/heads/master@{#404433}
    5059bca6