Closed
Bug 1320196
Opened 9 years ago
Closed 9 years ago
Eliminate unnecessary string concatenations in ImageCacheKey::ComputeHash
Categories
(Core :: Graphics: ImageLib, defect, P3)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
mozilla53
People
(Reporter: aosmond, Assigned: aosmond)
References
Details
(Whiteboard: gfx-noted)
Crash Data
Attachments
(1 file, 1 obsolete file)
|
3.81 KB,
patch
|
aosmond
:
review+
jcristau
:
approval-mozilla-aurora+
gchang
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
Hashing several strings appended together, and hashing them individually should result in the same value, except the latter is a much cheaper option.
http://searchfox.org/mozilla-central/rev/b4e6fa3527436bdbcd9dd2e1982382fe423431f3/image/ImageCacheKey.cpp#158
This allow triggers a malloc, which shows up in crash signatures, such as:
https://crash-stats.mozilla.com/report/index/77317c14-819d-4853-99ac-7bcaf2161118
The malloc is so big (presumably) because the URI spec can be quite large if it is just a base64 encoded image instead of a normal URL.
| Assignee | ||
Updated•9 years ago
|
Assignee: nobody → aosmond
Status: NEW → ASSIGNED
Priority: -- → P3
Whiteboard: gfx-noted
| Assignee | ||
Updated•9 years ago
|
Crash Signature: [@ OOM | large | NS_ABORT_OOM | nsACString_internal::Assign | mozilla::image::ImageCacheKey::ImageCacheKey ]
| Assignee | ||
Comment 1•9 years ago
|
||
try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=dec4057d18498db22bed7480dd730c991746da70
Attachment #8814245 -
Flags: review?(tnikkel)
| Assignee | ||
Updated•9 years ago
|
Comment 2•9 years ago
|
||
Comment on attachment 8814245 [details] [diff] [review]
Remove string concat in ImageCacheKey::ComputeHash, v1
Nice!
ImageURL::ComputeHash isn't a generic function, but rather specific to ImageCacheKey. So maybe make it private and mark ImageCacheKey as a friend class?
Attachment #8814245 -
Flags: review?(tnikkel) → review+
| Assignee | ||
Comment 3•9 years ago
|
||
Incorporate review feedback.
Attachment #8814245 -
Attachment is obsolete: true
Attachment #8814389 -
Flags: review+
Pushed by aosmond@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b8cdb59ac18b
Avoid string concatenation when computing the hash for ImageCacheKey. r=tnikkel
Comment 5•9 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
| Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8814389 [details] [diff] [review]
Remove string concat in ImageCacheKey::ComputeHash, v2 [carries r=tnikkel]
Approval Request Comment
[Feature/regressing bug #]: N/A
[User impact if declined]: May crash in low memory conditions.
[Describe test coverage new/current, TreeHerder]: The crash itself has only been observed in crash reports, not easily reproducible. However the crash occurs on a success path used every time an image is loaded and is thus well exercised by existing mochi/web-platorm/reftests.
[Risks and why]: Minimal, there was no functional change, only the need for some temporary allocations on the heap was removed.
[String/UUID change made/needed]: N/A
Attachment #8814389 -
Flags: approval-mozilla-aurora?
| Assignee | ||
Comment 7•9 years ago
|
||
Comment on attachment 8814389 [details] [diff] [review]
Remove string concat in ImageCacheKey::ComputeHash, v2 [carries r=tnikkel]
Approval Request Comment
[Feature/regressing bug #]: N/A
[User impact if declined]: May crash in low memory conditions.
[Describe test coverage new/current, TreeHerder]: The crash itself has only been observed in crash reports, not easily reproducible. However the crash occurs on a success path used every time an image is loaded and is thus well exercised by existing mochi/web-platorm/reftests.
[Risks and why]: Minimal, there was no functional change, only the need for some temporary allocations on the heap was removed.
[String/UUID change made/needed]: N/A
Attachment #8814389 -
Flags: approval-mozilla-beta?
Comment 8•9 years ago
|
||
Comment on attachment 8814389 [details] [diff] [review]
Remove string concat in ImageCacheKey::ComputeHash, v2 [carries r=tnikkel]
reduce risk of OOM, take in aurora52
Attachment #8814389 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 9•9 years ago
|
||
| bugherder uplift | ||
Comment 10•9 years ago
|
||
Comment on attachment 8814389 [details] [diff] [review]
Remove string concat in ImageCacheKey::ComputeHash, v2 [carries r=tnikkel]
Fix a crash. Beta51+. Should be in 51 beta 5.
Attachment #8814389 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Comment 11•9 years ago
|
||
| bugherder uplift | ||
You need to log in
before you can comment on or make changes to this bug.
Description
•