attachments: accessing attachment's message is very slow
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Triaged
|
High
|
Unassigned |
Bug Description
[Problem]
Performance processing attachments when referencing the message object really slows things down
https:/
[Discussion]
I love launchpadlib and use it a LOT for helping me get my work done on X.org. X.org bugs are really all about file attachments - crash dumps, log files, config files, yada yada. Pretty much every launchpadlib script I write deals with attachments in some way.
However, if you want to get the name of the uploader of the attachment, or when it was uploaded, this causes scripts to run a LOT slower. For interactive scripts this can result in it taking over a minute to load the bug. Even for non-interactive scripts this delay really reduces their usefulness.
I would like to see launchpadlib provide better optimized access to these details.
Attached is a test script I've used to do some performance measurements when different data is requested on a bug's attachments.
\time -f "%E" ./test_
Results
======
0. Just titles: 5.18 sec
1. do_a: 12.58
2. do_message: 42.33
3. do_a + do_message: 51.38
4. do_fb: 11.68
5. do_a + do_fb: 17.95
6. do_a + do_fb + do_message: 1:14.90
7. do_content: 11.84
8. do_a + do_content: 24.87
9. do_a + do_fb + do_content: 25.59
10. do_a + do_fb + do_message + do_content: 1:08.76
As you can see, it's faster to get all the files content (including printing contents to the screen!) than to print only the owner/date_
Something feels wrong - I would expect the difference between #1 and #3 to be on the order of maybe 4 sec max, not 40 sec. In this example bug, there is only a single message on the bug, compared with like 20 attachments, so you would expect #3 to be faster than #8, not take twice as long.
Fixes we need to CP from devel
=======
revno: 11156 [merge]
committer: Launchpad Patch Queue Manager <email address hidden>
branch nick: launchpad
timestamp: Mon 2010-07-19 18:32:16 +0100
message:
[r=lifeless]
changed to no longer materialise every message on a Bug before
returning the first one.
tags: | added: performance |
tags: | added: timeout |
description: | updated |
For now, the goal on this bug is to get an analysis of root cause. We'll regroup after that.