Closed Bug 696211 Opened 13 years ago Closed 13 years ago

Align ChunkInfo by inserting padding in Chunk

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla10

People

(Reporter: terrence, Assigned: terrence)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch v1 (obsolete) — Splinter Review
We get a 2% speedup on EarlyBoyer if ChunkInfo (hot all over the GC allocator paths) is not split across a cache line.  An easy and guaranteed effective way to do this is to just pad Chunk out to the full 1MiB allocation.  This makes ChunkInfo abut the end of the 1MiB allocation, rather than whereever the Arenas and ChunkBitmap happen to end.  Since GC Chunks are aligned at 1MiB address boundaries, this ensures that ChunkInfo is inside of a
cache line.
Attachment #568509 - Flags: review?(wmccloskey)
Speedup under 32bit linux build (running on 64bit) is an incredibly modest 0.2%, so this appears to be isolated to 64bit builds.
Status: NEW → ASSIGNED
Comment on attachment 568509 [details] [diff] [review]
v1

Nice job. Can you change the assert after the definition of Chunk to read:

JS_STATIC_ASSERT(sizeof(Chunk) == GC_CHUNK_SIZE);

(instead of <=)?
Attachment #568509 - Flags: review?(wmccloskey) → review+
Good catch!  I actually had this check my other patch but forgot about it, apparently.
Attachment #568509 - Attachment is obsolete: true
Attachment #568572 - Flags: checkin?(wmccloskey)
https://hg.mozilla.org/mozilla-central/rev/107c99294be7
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Attachment #568572 - Flags: checkin?(wmccloskey)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: