Bug 1853467 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

6.6% of our time on the Charts-chartjs subtest will be spent inside `obj_assign`.
(Once bug 1850775 is fixed, this percentage will rise to 7.6%.)

```js
const cloneIfNotShared = (cached, shared) => shared ? cached : Object.assign({}, cached);
```

It would be nice if we could find ways to speed this `Object.assign` call some more.

Firefox: https://share.firefox.dev/3PhKRJ7 3551 samples
Chrome: https://share.firefox.dev/3t4B69u 3059 samples

We're hitting the medium-fast but not the super-fast path; in other words, `TryAssignPlain` succeeds but we don't hit [the `toWasEmpty` path](https://searchfox.org/mozilla-central/rev/253125d1947acbc3033b7b2e3a9a0d1bf4358a2d/js/src/builtin/Object.cpp#928-933).

The call is of the form `Object.assign({}, cached)`. The `cached` object was created [here](https://github.com/mozilla/Speedometer/blob/dcc5e0f5ca1103d141473729843e5b7bb6f6a9e7/resources/charts/dist/assets/chartjs-7fd89fd7.js#L3836) with `Object.freeze`.

We're not going down the `toWasEmpty` super-fast path because the properties on the frozen object don't have the default property flags.

The first thing that stands out from the profile is that the gathered array of properties might be resized multiple times.
6.6% of our time on the Charts-chartjs subtest is spent inside `obj_assign`.
(Once bug 1850775 is fixed, this percentage will rise to 7.6%.)

```js
const cloneIfNotShared = (cached, shared) => shared ? cached : Object.assign({}, cached);
```

It would be nice if we could find ways to speed this `Object.assign` call some more.

Firefox: https://share.firefox.dev/3PhKRJ7 3551 samples
Chrome: https://share.firefox.dev/3t4B69u 3059 samples

We're hitting the medium-fast but not the super-fast path; in other words, `TryAssignPlain` succeeds but we don't hit [the `toWasEmpty` path](https://searchfox.org/mozilla-central/rev/253125d1947acbc3033b7b2e3a9a0d1bf4358a2d/js/src/builtin/Object.cpp#928-933).

The call is of the form `Object.assign({}, cached)`. The `cached` object was created [here](https://github.com/mozilla/Speedometer/blob/dcc5e0f5ca1103d141473729843e5b7bb6f6a9e7/resources/charts/dist/assets/chartjs-7fd89fd7.js#L3836) with `Object.freeze`.

We're not going down the `toWasEmpty` super-fast path because the properties on the frozen object don't have the default property flags.

The first thing that stands out from the profile is that the gathered array of properties might be resized multiple times.

Back to Bug 1853467 Comment 0