commit | ec8f7322826fb233062cb15cbb6df81141a3d12c | [log] [tgz] |
---|---|---|
author | Omer Katz <omerkatz@chromium.org> | Fri Jul 12 09:03:42 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Jul 12 09:03:42 2019 |
tree | 1b8bb28fb20884c661636488e935a4bfe10cf4ed | |
parent | 8386aa4561bbb10d3fa4ec2236b809ab923bb90a [diff] |
heap: Optimize PreFinalizer traversal This CL optimizes pre-finalizer invocation. Previously, we would maintain pre-finalizers in a LinkedHashSet and invoke as follows: 1. Create a reversed copy of pre-finalizers in a Vector 2. Iterate the vector 2.a Invoke pre-finalizers on dead objects 2.b Remove dead objects from HashSet Instead, we now maintain pre-finalizers in a Deque and invoke as follows: 1. Iterate the deque backwards 2. Store non-pre-finalized (live) objects in a new Deque 3. Move the new Deque over. This improves performance on selected microbenchmarks by at least 25% (and up to 65%). Bug: 981043 Change-Id: I0f3e3bbbc9c75ca017b11c6d60f991b1a68b44be Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1698465 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Omer Katz <omerkatz@chromium.org> Cr-Commit-Position: refs/heads/master@{#676801}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .