Closed Bug 516594 Opened 16 years ago Closed 14 years ago

Reduce calls to IsLowMemory() from imagelib

Categories

(Core :: Graphics: ImageLib, defect)

defect
Not set
major

Tracking

()

RESOLVED WONTFIX

People

(Reporter: dougt, Unassigned)

Details

Attachments

(1 file)

Attached patch patch v.1Splinter Review
Turns out that calling IsLowMemory() can take as much as 2-4ms on some mobile platforms, and we call it alot from imglib. I would like to reduce such calls -- maybe when we are writing less than 32k?
Attachment #400616 - Flags: review?(joe)
Attachment #400616 - Flags: review?(joe) → review-
Comment on attachment 400616 [details] [diff] [review] patch v.1 mSize.width * mSize.height * 4
well, hell.... if I am seeing this makes a difference, that means what? that we have lots of small images that are causing this much noise? Maybe we should do a better job caching? Fennec has a 1mb image cache.
Right now you're just comparing width * height, which is not a size in bytes, it's a size in pixels. If you want to use bytes, you have to multiply by 4.
well, i see that now. :-) i suppose I am asking more a fundamental question. basically my calculations were off by 4x. which means that I am only filtering very very small images from this IsLowMemory check. I am wondering why I am seeing a bunch of these when I am panning around in fennec. eg. why aren't they cached / why are they being re-decoded.
isLowMemory() is deprecated. i removed these calls a while ago, so this patch isn't needed.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: