• dpapad's avatar
    MD Extensions: Drop unnecessary work when first populating the list. · 32bb3b90
    dpapad authored
    During initial population of the extensions and apps lists, addItem()
    was called N times, which internally performs a linear search N times,
    as well as triggres splice() notifications that are unnecessary.
    
    As revealed by DevTools (for a total of 30 extensions and apps):
     - before: the N calls to addItem() were taking ~22ms total
     - after: The initialization of the lists takes ~5ms total 
    
    Bug: 764126
    Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
    Change-Id: If66d752cd3e7ac4b4ecd01ea4964ca6fd8d8f0db
    Reviewed-on: https://chromium-review.googlesource.com/746967Reviewed-by: default avatarDave Schuyler <dschuyler@chromium.org>
    Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#512989}
    32bb3b90
service.js 9.73 KB