Closed Bug 718885 Opened 14 years ago Closed 14 years ago

Optimize memory initialization on ByteArray growth

Categories

(Tamarin Graveyard :: API, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: turo, Assigned: pnkfelix)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.51.22 (KHTML, like Gecko) Version/5.1.1 Safari/534.51.22 Steps to reproduce: I was profiling several ByteArray heavy applications. Actual results: memset shows up as the #3 call in the totals list and the source of that is ByteArray::Grower::EnsureWritableCapacity(uint32_t minimumCapacity) which allocates a new buffer with the MMgc::kCanFailAndZero attribute. This will needlessly zero the entire buffer. Expected results: The code can be easily optimized to only zero the memory areas which will not be overwritten by the old data. See attached patch.
Assignee: nobody → fklockii
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #589347 - Attachment is patch: true
Comment on attachment 589347 [details] [diff] [review] ByteArrayMemsetPatch.txt will push
Attachment #589347 - Flags: review+
changeset: 7192:d0f8ed436179 user: Tinic Uro <turo@adobe.com> summary: Bug 718885: only zero the memory areas which will not be overwritten by the old data (r=fklockii). http://hg.mozilla.org/tamarin-redux/rev/d0f8ed436179
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: