Re: [Geary] Slow startup

Startup time is a perpetual issue with Geary, one I'm always thinking about.

The debug message you're seeing is not about startup per se.  Inside the database layer there's a logging trigger attached to the length of time any database transaction takes.  If it's over one second, the statement is logged.  It's not always crucial, but it often is, especially if it's multiple seconds in length.

Without characterizing your system, I can't say with certainty this particular transaction is the cause of the problem.  (This particular SQL statement is used by a background task and it may or may not be blocking other activity.  Geary uses multiple threads to connect to the database and read operations do not necessarily block other operations.)

Because Geary is asynchronous, it's sometimes difficult to pinpoint bottlenecks in the code.  When I attack startup, I insert timers in the code and look for long lags.  If it's taking a long time for a new message to get pulled down, I look at the normalize_folders() method in ImapEngine.MinimalFolder, as that's the code that compares the local folder to the remote folder and makes whatever changes are required to get them synchronized.  That's where messages that have arrived before running Geary are detected and signalled, which kick off (a) the client requesting the envelope to display to the user, and (b) ImapEngine.EmailPrefetcher pulling down the full message so it's in the database.

I would also run with --log-network (or even --log-serializer --log-deserializer, but that will generate a *log* of debug) to see where in protocol state the lag is taking place.  Since the IMAP traffic is representative of the Geary engine's state as a whole, that can sometimes pinpoint bottlenecks.

Anyway, that's a long-winded answer, but hopefully it gives you a place to start.

-- Jim

On Sat, Jul 26, 2014 at 4:45 PM, Robert Schroll <rschroll gmail com> wrote:
Hi all, Recently, I've noticed that Geary takes a rather long time starting up if there are new messages. It takes the better part of a minute before the new conversations show up in the conversation list. Before they appear, I see this debug message many times:
[deb] 19:34:07 1.023782 db-result.vala:41: DB QUERY STEP " SELECT id FROM MessageTable WHERE fields <> ? " elapsed=1.023748
This only happens on startup, I think; Geary is fairly quick on resuming from sleep. Since I tend to leave it running all the time, I don't experience this often, so I can't say when it started as a problem. Is this a known issue? Is there any debugging I can do to help? Thanks, Robert _______________________________________________ geary-list mailing list geary-list gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]