Open
Bug 1116742
Opened 10 years ago
Updated 2 years ago
Reduce locking in FrameAnimator
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
NEW
People
(Reporter: seth, Unassigned)
References
Details
Attachments
(5 files, 2 obsolete files)
(deleted),
patch
|
tnikkel
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
tnikkel
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
tnikkel
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
tnikkel
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
tnikkel
:
review+
|
Details | Diff | Splinter Review |
In bug 1116733 we made imgFrame accessors do more locking. The patches in that bug tried to improve efficiency somewhat, but FrameAnimator still takes the lock a lot. To fix that in a really clean way, a major refactoring of FrameAnimator is needed, but I don't have time to do it right now. This bug is intended to reduce the amount of locking FrameAnimator does as much as possible without major changes to its design.
Reporter | ||
Comment 1•10 years ago
|
||
This patch reduces locking by three strategies:
- GetSingleLoopLength caches its result.
- Pure functions that don't do anything that requires locking replace existing
functions that required locking where possible. This is used for
GetCurrentImgFrameEndTime, which turns into GetFrameEndTime, and
GetTimeoutForFrame, which turns into NormalizedTimeout, although the original
API also remains since code outside FrameAnimator calls it.
- For code in the main set of functions (RequestRefresh, AdvanceFrame, and
DoBlend), I've used the approach of doing the things that require locking a
single time, in RequestRefresh, and then passing the results into AdvanceFrame
and DoBlend. This does have the unfortunate side effect of making
RequestRefresh in particular much uglier, I'm afraid. As I mentioned above,
doing this cleanly will require a more substantial refactoring that I don't
have time to do. =\
Attachment #8542941 -
Flags: review?(tnikkel)
Reporter | ||
Comment 2•10 years ago
|
||
Try job here:
https://tbpl.mozilla.org/?tree=Try&rev=f51802df097e
Reporter | ||
Comment 3•10 years ago
|
||
A lot of those failures seem to have come from patches earlier in my patch stack. Here's a new try job:
https://tbpl.mozilla.org/?tree=Try&rev=b2d2cbd1d242
Reporter | ||
Updated•10 years ago
|
Attachment #8542941 -
Attachment is obsolete: true
Attachment #8542941 -
Flags: review?(tnikkel)
Reporter | ||
Comment 4•10 years ago
|
||
I decided to split up this patch to make it easier to debug and review. These
patches contain the same stuff that the original single patch did.
Attachment #8545571 -
Flags: review?(tnikkel)
Reporter | ||
Comment 5•10 years ago
|
||
Attachment #8545572 -
Flags: review?(tnikkel)
Reporter | ||
Comment 6•10 years ago
|
||
Attachment #8545574 -
Flags: review?(tnikkel)
Reporter | ||
Comment 7•10 years ago
|
||
Attachment #8545577 -
Flags: review?(tnikkel)
Reporter | ||
Comment 8•10 years ago
|
||
Attachment #8545580 -
Flags: review?(tnikkel)
Reporter | ||
Comment 9•10 years ago
|
||
New try job here:
https://tbpl.mozilla.org/?tree=Try&rev=67b12a9798b2
Reporter | ||
Comment 10•10 years ago
|
||
Fixed a bug: we should make sure that we're done decoding before assuming that
being at the end of the frame list means we should loop.
Attachment #8545663 -
Flags: review?(tnikkel)
Reporter | ||
Updated•10 years ago
|
Attachment #8545577 -
Attachment is obsolete: true
Attachment #8545577 -
Flags: review?(tnikkel)
Reporter | ||
Comment 11•10 years ago
|
||
New try job here:
https://tbpl.mozilla.org/?tree=Try&rev=b8002e1cbd48
Comment 12•10 years ago
|
||
Comment on attachment 8545571 [details] [diff] [review]
(Part 1) - Return more information from imgFrame::AnimationData
Is there a reason we need the AnimationData() (no arguments) constructor?
Attachment #8545571 -
Flags: review?(tnikkel) → review+
Reporter | ||
Comment 13•10 years ago
|
||
(In reply to Timothy Nikkel (:tn) from comment #12)
> Comment on attachment 8545571 [details] [diff] [review]
> (Part 1) - Return more information from imgFrame::AnimationData
>
> Is there a reason we need the AnimationData() (no arguments) constructor?
Yeah, but it doesn't show up until part 4. =) It's so we can declare an AnimationData object outside of the loop in FrameAnimator::RequestRefresh, which allows us to share the same object between loop iterations. That makes sense, because in one iteration a frame is the "next frame", and in the next iteration it's the "previous frame".
Updated•10 years ago
|
Attachment #8545572 -
Flags: review?(tnikkel) → review+
Updated•10 years ago
|
Attachment #8545574 -
Flags: review?(tnikkel) → review+
Updated•10 years ago
|
Attachment #8545663 -
Flags: review?(tnikkel) → review+
Updated•10 years ago
|
Attachment #8545580 -
Flags: review?(tnikkel) → review+
Comment 14•3 years ago
|
||
The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.
Assignee: seth.bugzilla → nobody
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•