Closed Bug 1061646 Opened 10 years ago Closed 10 years ago

CheckForInterrupt is slower on windows

Categories

(Core :: JavaScript Engine, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla35

People

(Reporter: h4writer, Assigned: h4writer)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

Looking on octane-regexp, CheckForInterrupt tend to take more time in windows than in linux. Especially in StrReplaceRegexpRemove.

I haven't really being able to figure out why yet.
Blocks: 1028242
It might be worth looking at what assembly gets generated for the boolean test of cx->runtime->interrupt.  Its type is Atomic<bool, Relaxed> so it should just compile down to an unsynchronized load; but maybe something is messed up on windows.  (I mention this b/c we initially had a regression when someone changed 'interrupt' from a 'volatile bool' to an 'Atomic<bool>' which was fixed by changing to 'Atomic<bool, Relaxed>'.)
(In reply to Luke Wagner [:luke] from comment #1)
> It might be worth looking at what assembly gets generated for the boolean
> test of cx->runtime->interrupt.  Its type is Atomic<bool, Relaxed> so it
> should just compile down to an unsynchronized load; but maybe something is
> messed up on windows.  (I mention this b/c we initially had a regression
> when someone changed 'interrupt' from a 'volatile bool' to an 'Atomic<bool>'
> which was fixed by changing to 'Atomic<bool, Relaxed>'.)

Good suggestion, I'll look at that.
Keywords: leave-open
Just force it to inline, though in most cases msvc already inlined it.
Assignee: nobody → hv1989
Attachment #8482726 - Flags: review?(jorendorff)
Like Luke already mentioned. This is because we lock on windows. I opened bug 1061764 for this.
Depends on: 1061764
Attached patch Workaround (obsolete) — Splinter Review
This is a workaround which fixes this slowdown. (If mfbt cannot get adjusted to fix this or if there is no solution before the next train departs)
Attachment #8482800 - Attachment is obsolete: true
The depending bug landed, so this can get closed. I'll leave it open untill this small patch here lands.
Keywords: leave-open
Comment on attachment 8482726 [details] [diff] [review]
Use MOZ_ALWAYS_INLINE instead of inline

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

Sure.
Attachment #8482726 - Flags: review?(jorendorff) → review+
https://hg.mozilla.org/mozilla-central/rev/d5581850426c
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: