attachments: accessing attachment's message is very slow
Performance processing attachments when referencing the message object really slows things down
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_
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
changed to no longer materialise every message on a Bug before
returning the first one.
|Changed in launchpadlib:|
|status:||New → Triaged|
|importance:||Undecided → High|
|assignee:||nobody → Leonard Richardson (leonardr)|
|affects:||launchpadlib → launchpad-foundations|
|Robert Collins (lifeless) wrote : Re: [Bug 424671] Re: attachments: accessing attachment's message is very slow||#12|
|Changed in launchpad:|
|assignee:||Leonard Richardson (leonardr) → nobody|