Closed Bug 120299 Opened 23 years ago Closed 23 years ago

Drop feedback is narrow first time

Categories

(Core :: XUL, defect, P3)

x86
All
defect

Tracking

()

RESOLVED FIXED
mozilla0.9.9

People

(Reporter: janv, Assigned: janv)

Details

Attachments

(1 file, 3 obsolete files)

Attached patch possible fix (obsolete) — Splinter Review
Outliner's image cache uses as key style contexts. It depends on prefilled array of properties. So it's possible to have different entries in cache for same image requests. I measured it, folder pane has about 50 entries in the cache. Default/initial cache size is 64 entries. I know image lib has own cache, but I think we shouldn't keep redundant image requests in outliner's cache. In that patch I chanched it to use image URL (string key) and initial size to 16 entries. It reduced number of entries to about 13 for folder pane. Drop feedback is narrow first time, because scratch array contains new property (drop/dropBefore/dropAfter) and thus it doesn't find image request in its cache. Sounds reasonable ?
Status: NEW → ASSIGNED
Priority: -- → P3
Summary: Drop feedback is stretched first time. → Drop feedback is narrow first time
Target Milestone: --- → mozilla0.9.9
I suggested doing this a while ago, and hyatt said "I'm fairly convinced that using URIs as keys would be slower than the way it works now"
Yeah, it would be slightly slower and more malloc happy. Ccing brendan for possible hashing tips.
Measure first and see if the difference isn't in the noise -- yeah, nsStringKey is malloc-happy, but I wonder with the low call counts why this'll hurt. If there's no opaque, unique-per-image pointer to use, it seems to me the URI must be the key. /be
Attached patch working patch (obsolete) — Splinter Review
sigh, hand-modified patches
Attachment #65977 - Attachment is obsolete: true
Comment on attachment 67502 [details] [diff] [review] working patch r=sfraser This patch fixes the Mac drawing issues.
Attachment #67502 - Flags: review+
I'm uncomfortable with this patch, since the current cache prevents mallocs of URIs in the common cases (straight display and scrolling). Also, imglib is *already* hashing in a second tier cache by URI. I think the real problem here is just that there's an invalidate happening during cell painting when an image is already available in the cache. In this case, no extra invalidate needs to occur. I would suggest adding a guard against invalidation in the code that gets the image. Set a stack-based variable to true right before the call to il-> LoadImage, and then don't let the invalidate happen in the case where imglib responds synchronously. e.g., mImageGuard = PR_TRUE; il->LoadImage(); mImageGuard = PR_FALSE; and in the listener... if (!mImageGuard) Invalidate(); But hashing on the URI is redundant and malloc-happy (and you'll repeatedly re-malloc and build the same URI over and over again).
Attachment #67502 - Flags: needs-work+
Attached patch new patch (obsolete) — Splinter Review
Attachment #67502 - Attachment is obsolete: true
Yeah, looks good. Assuming it fixes the bug, sr=hyatt.
Comment on attachment 67514 [details] [diff] [review] new patch r=sfraser, this fixes the bug (so adding hyatt's sr)
Attachment #67514 - Flags: superreview+
Attachment #67514 - Flags: review+
Attached patch real fixSplinter Review
Try to get an image after load (in a case it was already cached). Added comments.
Attachment #67514 - Attachment is obsolete: true
a=asa (on behalf of drivers) for checkin to 0.9.8
landed on the trunk and branch
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
this is probably covering or the same as bug 121187
no, it is not the same
Component: XP Toolkit/Widgets: Trees → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: