Opened 3 years ago

Closed 3 years ago

#1486526 closed Feature Requests (fixed)

Performance improvements in check_recent

Reported by: alec Owned by: alec
Priority: 5 Milestone: 0.4-stable
Component: PHP backend Version: 0.3.1
Severity: normal Keywords: performance check_recent
Cc:

Description

New check_recent method in r3306 works like this:

[03-Mar-2010 08:49:47 +0100]: C: fuid FETCH 1022 (UID)
[03-Mar-2010 08:49:47 +0100]: S: * 1022 FETCH (UID 7825)
[03-Mar-2010 08:49:47 +0100]: S: fuid OK Fetch completed.

This is from _id2uid. We could store both max_uid and max_id and when max_id = <EXISTS count> we don't need to call id2uid. It means we can skip this FETCH always when folder status is not changed (EXISTS is the same as in last call) - very often.

[03-Mar-2010 08:49:47 +0100]: C: fhi0 UID FETCH 7823:* (UID)
[03-Mar-2010 08:49:47 +0100]: S: * 1020 FETCH (UID 7823)
[03-Mar-2010 08:49:47 +0100]: S: * 1021 FETCH (UID 7824)
[03-Mar-2010 08:49:47 +0100]: S: * 1022 FETCH (UID 7825)
[03-Mar-2010 08:49:47 +0100]: S: fhi0 OK Fetch completed.
[03-Mar-2010 08:49:47 +0100]: C: srch1 SEARCH ALL UNSEEN
[03-Mar-2010 08:49:47 +0100]: S: * SEARCH 1019 1020 1021 1022
[03-Mar-2010 08:49:47 +0100]: S: srch1 OK Search completed (0.000 secs).
[03-Mar-2010 08:49:47 +0100]: C: s SORT (DATE) utf-8 ALL UID 7823:7825
[03-Mar-2010 08:49:47 +0100]: S: * SORT 1020 1021 1022
[03-Mar-2010 08:49:47 +0100]: S: s OK Sort completed.

It's called only when folder status changes, but I think these three commands could be replaced with one SORT command. It means we could create a new extended recent_headers() function and use it instead of recent_uids+search+list_headers.

Change History (1)

comment:1 Changed 3 years ago by alec

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [48807496].

Note: See TracTickets for help on using tickets.