Closed Bug 1917993 Opened 2 years ago Closed 2 years ago

Cards view reads all of the tag preferences once for every card

Categories

(Thunderbird :: Folder and Message Lists, defect)

defect

Tracking

(thunderbird_esr128+ fixed, thunderbird131 fixed)

RESOLVED FIXED
132 Branch
Tracking Status
thunderbird_esr128 + fixed
thunderbird131 --- fixed

People

(Reporter: darktrojan, Assigned: darktrojan)

References

Details

(Keywords: perf:responsiveness)

Attachments

(2 files, 1 external file)

Attached image image.png —

MailServices.tags.getAllTags() becomes a very expensive operation when it gets called many times. There must be a better way than to call it every time we create a card.

Assignee: nobody → geoff
Status: NEW → ASSIGNED
Attached image image.png —

A small improvement. :-)

See Also: → 1342054
Target Milestone: --- → 132 Branch

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/4dbe6597743b
Improve performance of tags display in cards view. r=aleca

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED

good for beta?

Flags: needinfo?(geoff)

Geoff, We're going to pick this up for beta. Please let us know if you have any concerns with shipping this.

Comment on attachment 9424550 [details]
Bug 1917993 - Improve performance of tags display in cards view. r=#thunderbird-reviewers

[Triage Comment]
Approved for beta

Attachment #9424550 - Flags: approval-comm-beta+
Flags: needinfo?(geoff)

That's some impressive jank.

Geoff, how many tags were used in causing that, or at what number would users be affected?

Flags: needinfo?(geoff)

I think that was a new profile, so just the default 5 tags. It would affect everybody, but only in a situation like this (loading message headers in a folder for the first time) where the message list rows are being updated thousands of times, which is its own special kind of bad performance.

Flags: needinfo?(geoff)

So examples would be on startup and switching folders?
Is it hitting for every message in the folder, or only those in view at the time?

Flags: needinfo?(geoff)

(In reply to Wayne Mery (:wsmwk) from comment #10)

So examples would be on startup and switching folders?

No, just when message headers are first downloaded from a server. So when an account has just been added, or I suppose if you happen to be looking at a folder that gets a lot of new mail all at once (e.g. my bugmail folder after a week away).

When a message arrives a new card is put at the top of the list, and all the cards below it are updated (1 hit each to getAllTags before this patch). Repeat for every new message. Yes, this is absurd. Fixing it is hard.

In most normal use though, nobody would notice the bad performance.

Is it hitting for every message in the folder, or only those in view at the time?

It's once for every card that is created or refreshed. So yes, only the messages in view and just out-of-view, but in the bad case that's the whole visible list × every new message.

Flags: needinfo?(geoff)

Geoff, is this ready for esr128?

Flags: needinfo?(geoff)

Comment on attachment 9424550 [details]
Bug 1917993 - Improve performance of tags display in cards view. r=#thunderbird-reviewers

[Approval Request Comment]
Regression caused by (bug #): new cards view
User impact if declined: performance when loading lots of cards at once
Testing completed (on c-c, etc.): in 131 b6
Risk to taking this patch (and alternatives if risky): a little, I'd like this to have more time on beta but if the next ESR is on schedule in 10 days that should be enough

Flags: needinfo?(geoff)
Attachment #9424550 - Flags: approval-comm-esr128?

Comment on attachment 9424550 [details]
Bug 1917993 - Improve performance of tags display in cards view. r=#thunderbird-reviewers

[Triage Comment]
Approved for esr128

Attachment #9424550 - Flags: approval-comm-esr128? → approval-comm-esr128+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: