• Charles Harrison's avatar
    [safe-browsing] prefix matching improvements and perftest · 17809751
    Charles Harrison authored
    This CL does a few things:
    1. Replaces HashPrefixMatches which was implemented with a custom binary
       search with a custom iterator and std::binary_search.
    2. Adds a perftest stress testing this method.
    
    Running the perftest before and after the binary_search change shows that
    using binary_search improves performance by 30-40%. This was measured
    on Linux using a release (non-official) build.
    
    It is also imo a code health win, as an iterator is easier to reason
    about than a custom binsearch algorithm.
    
    Bug: 787092
    Change-Id: Ic8be26b11ef750c70ee241dfb2718a3c0855fc8c
    Reviewed-on: https://chromium-review.googlesource.com/959623
    Commit-Queue: Charlie Harrison <csharrison@chromium.org>
    Reviewed-by: default avatarScott Violet <sky@chromium.org>
    Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#543391}
    17809751
v4_store_perftest.cc 1.69 KB