Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Issue 19541010: Implement optimized objectInfo structure (Closed)

Created:
7 years, 5 months ago by rafaelw
Modified:
7 years, 3 months ago
Reviewers:
rossberg, adamk
Base URL:
https://github.com/v8/v8.git@bleeding_edge
Visibility:
Public.

Description

This patch implements optimized objectInfo structure which manages the set of observers associated with an object and the changeRecord types which they accept. Observation in the normal case (Object.observe, default accept types, one observer) now allocates fewer objects and unobservation no longer needs to scan and splice an InternalArray -- making the combined speed of observe/unobserve about 200% faster. This patch implements the following optimizations: -objectInfo is initially created without any connected objects or arrays. The first observer is referenced directly by objectInfo, and when a second observer is added, changeObservers converts to a mapping of callbackPriority->observer, which allows for constant time registration/de-registration. -observer.accept and objectInfo.performing are conceptually the same data-structure. This is now directly represented as an abstract "TypeMap" which can later be optimized to be a smi in common cases, (e.g: https://codereview.chromium.org/19269007/). -objectInfo observers are only represented by an object with an accept typeMap if the set of accept types is non-default R=rossberg@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=16629

Patch Set 1 #

Patch Set 2 : dont use closure for delivery #

Patch Set 3 : added comments #

Total comments: 22

Patch Set 4 : cr comments, more refactoring #

Patch Set 5 : rebase #

Total comments: 18

Patch Set 6 : cr changes #

Patch Set 7 : moar #

Patch Set 8 : cr changes #

Patch Set 9 : whitespace #

Patch Set 10 : fix cctest #

Unified diffs Side-by-side diffs Delta from patch set Stats (+259 lines, -161 lines) Patch
M src/object-observe.js View 1 2 3 4 5 6 7 13 chunks +255 lines, -157 lines 0 comments Download
M test/cctest/test-object-observe.cc View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -4 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
rafaelw
https://codereview.chromium.org/19541010/diff/4001/src/object-observe.js File src/object-observe.js (right): https://codereview.chromium.org/19541010/diff/4001/src/object-observe.js#newcode35 src/object-observe.js:35: observationState.pendingObservers = { __proto__: null }; Note that this ...
7 years, 5 months ago (2013-07-19 22:21:41 UTC) #1
adamk
I have to say this code is getting a little bit hard to read. I've ...
7 years, 5 months ago (2013-07-23 21:48:08 UTC) #2
rafaelw
https://codereview.chromium.org/19541010/diff/4001/src/object-observe.js File src/object-observe.js (right): https://codereview.chromium.org/19541010/diff/4001/src/object-observe.js#newcode79 src/object-observe.js:79: return { __proto__: null }; I have a follow-on ...
7 years, 4 months ago (2013-08-02 20:10:32 UTC) #3
rafaelw
andreas, ptal
7 years, 4 months ago (2013-08-06 19:59:52 UTC) #4
rossberg
Looks mostly good, although I think that by now this file could use an introductory ...
7 years, 4 months ago (2013-08-07 13:02:14 UTC) #5
rafaelw
I've added some overview commentary at the top of the file, and also made sure ...
7 years, 4 months ago (2013-08-07 20:36:28 UTC) #6
rossberg
https://codereview.chromium.org/19541010/diff/14001/src/object-observe.js File src/object-observe.js (right): https://codereview.chromium.org/19541010/diff/14001/src/object-observe.js#newcode177 src/object-observe.js:177: // observer is referenced directly via objectInfo.changeObserver. When a ...
7 years, 4 months ago (2013-08-09 11:26:51 UTC) #7
rafaelw
PTAL https://codereview.chromium.org/19541010/diff/14001/src/object-observe.js File src/object-observe.js (right): https://codereview.chromium.org/19541010/diff/14001/src/object-observe.js#newcode177 src/object-observe.js:177: // observer is referenced directly via objectInfo.changeObserver. When ...
7 years, 4 months ago (2013-08-09 14:14:37 UTC) #8
rossberg
LGTM, but deferring land til tree is open again https://codereview.chromium.org/19541010/diff/14001/src/object-observe.js File src/object-observe.js (right): https://codereview.chromium.org/19541010/diff/14001/src/object-observe.js#newcode501 src/object-observe.js:501: ...
7 years, 4 months ago (2013-08-13 09:19:25 UTC) #9
rafaelw
I'm assuming the tree is still closed. Please land when you are able. Thanks https://codereview.chromium.org/19541010/diff/14001/src/object-observe.js ...
7 years, 4 months ago (2013-08-19 18:51:24 UTC) #10
adamk
Was about to land this (as the tree now seems to be open), but it ...
7 years, 3 months ago (2013-08-26 19:50:45 UTC) #11
rafaelw
fixed. thanks.
7 years, 3 months ago (2013-08-26 20:37:09 UTC) #12
adamk
Committed patchset #10 manually as r16343 (presubmit successful).
7 years, 3 months ago (2013-08-26 21:37:27 UTC) #13
adamk
Committed patchset #10 manually as r16539 (presubmit successful).
7 years, 3 months ago (2013-09-04 19:21:35 UTC) #14
adamk
On 2013/09/04 19:21:35, adamk wrote: > Committed patchset #10 manually as r16539 (presubmit successful). Failed ...
7 years, 3 months ago (2013-09-04 20:39:16 UTC) #15
adamk
On 2013/09/04 20:39:16, adamk wrote: > On 2013/09/04 19:21:35, adamk wrote: > > Committed patchset ...
7 years, 3 months ago (2013-09-04 20:48:58 UTC) #16
adamk
7 years, 3 months ago (2013-09-10 18:14:00 UTC) #17
Message was sent while issue was closed.
Committed patchset #10 manually as r16629 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698