[snapshot] optimizing WatchedArrayList snapshot
ArrayList.add(index, value) does an array copy everytime to extend the underlying array. Here we already knew the size of that array and ensured the capacity so we should only call ArrayList.add(value) which does not involve array copying. We need to examine other Watched* classes and try to spot performance issues like this. BUG: 231373522 Test: forrest run Change-Id: Iab440fc809072e9b1ee1bef7d69a0dc04207bafb
Loading
Please register or sign in to comment