Closed Bug 1487341 Opened 6 years ago Closed 6 years ago

Simplify Truncate(), SetLength() and Capacity() and write them in terms of StartBulkWriteImpl()

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: hsivonen, Assigned: hsivonen)

References

Details

(Keywords: perf)

Attachments

(1 file)

Once bug 1486711 has landed successfully, Truncate(), SetLength() and Capacity() can become simpler and faster.
Note to self: Search for SetCapacity(0) and replace with Truncate().
(In reply to Henri Sivonen (:hsivonen) from comment #3)
> Try run:
> https://treeherder.mozilla.org/#/
> jobs?repo=try&revision=e48f40d3918333a5c97c6a79ed9145da3b8e2811

Lots and lots of
application crashed [@ mozilla::Base64URLEncode(unsigned int, unsigned char const*, mozilla::Base64URLEncodePaddingPolicy, nsTSubstring<char>&)]
I managed to miss a SetCapacity() call in Base64.cpp!
Attachment #9005160 - Attachment description: Bug 1487341 - Simplify Truncate(), SetLength() and Capacity() by writing them in terms of StartBulkWriteImpl(). → Bug 1487341 - Make Truncate(), SetLength() and Capacity() more efficient by keeping memcpying to the minimum.
Keywords: perf
Comment on attachment 9005160 [details]
Bug 1487341 - Make Truncate(), SetLength() and Capacity() more efficient by keeping memcpying to the minimum.

Nathan Froyd [:froydnj] has approved the revision.
Attachment #9005160 - Flags: review+
(In reply to Henri Sivonen (:hsivonen) from comment #10)
> Opt try run after rebase:
> https://treeherder.mozilla.org/#/
> jobs?repo=try&revision=125dda84e41afb61428bd18a8d10552dff5107d1

This is full of fail.

I'll try to track down what goes wrong. For starters, trying to repro locally leads to a hang when the sandboxing code calls lstat for /sys/dev/char/ . I'll try to see if I get something more tractable in gtest with the sandbox disabled.
Oops. I had a function call whose side effects mattered within the argument of a MOZ_ASSERT.
Pushed by hsivonen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0bb09351c1c1
Make Truncate(), SetLength() and Capacity() more efficient by keeping memcpying to the minimum. r=froydnj
https://hg.mozilla.org/mozilla-central/rev/0bb09351c1c1
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Need to investigate if bug 1494634 is fallout from this one in the sense of this change exposing some edge case bug that has remained hidden for a decade.
Component: String → XPCOM
You need to log in before you can comment on or make changes to this bug.