Closed Bug 1275033 Opened 4 years ago Closed 4 years ago

Don't call into the VM for global objects that are already in the store buffer

Categories

(Core :: JavaScript: GC, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(1 file)

We have a flag on the compartment that we use to check whether the global is already in the store buffer.  We can check this in the JIT to save us a call into the VM if the flag is set.

Tested with the following microbenchmark:

    for (let i = 0; i < 100000000; i++)
        x = { x: i*2 };

Original time: 0.797 seconds
Time with patch: 0.541 seconds
Attachment #8755481 - Flags: review?(jdemooij)
Summary: Don't call into the VM for global objects that have already in the store buffer → Don't call into the VM for global objects that are already in the store buffer
Attachment #8755481 - Attachment is patch: true
Comment on attachment 8755481 [details] [diff] [review]
optimize-global-write-barrier

Review of attachment 8755481 [details] [diff] [review]:
-----------------------------------------------------------------

Nice!

::: js/src/gwb.js
@@ +1,1 @@
> +for (let i = 0; i < 100000000; i++)

Nit: don't add this file
Attachment #8755481 - Flags: review?(jdemooij) → review+
https://hg.mozilla.org/mozilla-central/rev/3a7ba1ce51d6
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
I messed up and landed the wrong version of the patch.  I'm going to backout and reopen this bug.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla49 → ---
See Also: → 1276908
Some performance results from the gwb.js microbenchmark in bug 1276908 comment 2:

Initial:
    global
            0.76 real         0.75 user         0.01 sys
            0.76 real         0.74 user         0.01 sys
            0.76 real         0.75 user         0.01 sys

With patch:
    global
            0.53 real         0.52 user         0.01 sys
            0.53 real         0.51 user         0.01 sys
            0.52 real         0.51 user         0.01 sys
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0d258790a406
Don't call into the VM for global objects that are already in the store buffer r=jandem
https://hg.mozilla.org/mozilla-central/rev/0d258790a406
Status: REOPENED → RESOLVED
Closed: 4 years ago4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in before you can comment on or make changes to this bug.