Closed Bug 1035804 Opened 10 years ago Closed 8 years ago

BzAPI compatibility layer bug query response takes 76s vs 6s for rest

Categories

(bugzilla.mozilla.org :: Extensions, defect)

Production
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: emorley, Assigned: dylan)

References

(Depends on 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

the search itself is fast. time is spent in two places: 1. creating bug objects for each bug in Bugzilla::WebService::Bug::search() .. new_from_list() 2. search_bugs_response (morphing each bug)
It is not a trivial fix as I originally though as Bugzilla::Search does not return product_id and component_id in the results data. So it is not as simple to take the results data, convert to hash and pass to Bugzilla::Bug->new_from_hash. Bugzilla::Search would need to be altered as well to support this. dkl
Assignee: nobody → glob
Depends on: 1039940
No longer depends on: 880669
on my development system that query takes ~ 21s i committed bug 880097 last week; this reduced the time to ~ 14s i have a patch on bug 1039940 which brings this down to ~ 10s the real gains are to be had in bug 1061233, where i'm rewriting the serialisation code from scratch.
Depends on: 1061233
No longer depends on: 1039940
With bug 880097 and bug 1039940 landed, the query in comment 0 took 84-85s, vs the 76s of comment 0. That said, the bzapi query now takes 7.0-7.5s rather than 6.5s, presumably since the number of bugs returned by both has increased since this bug was filed. Even so, it unfortunately seems like the 50% reduction locally in comment 3 hasn't been seen in production, which is a bit odd.
(In reply to Ed Morley [:edmorley] from comment #4) > With bug 880097 and bug 1039940 landed, the query in comment 0 took 84-85s, > vs the 76s of comment 0. s/took/now takes/
Assignee: glob → nobody
See Also: → 1301541
See what you've made me do, Ed! Profiling things is very addictive to me, so I've gone and profiled this. http://people.mozilla.org/~dhardison/nytprof/bzapi/ It looks like if we add by_name => 1 to the call to Bugzilla->fields() we can save 91 seconds. Many other parts that are slow in this are known problems and not specific to bzapi.
Assignee: nobody → dylan
Attached patch hacks.patch (obsolete) — Splinter Review
Attached patch hacks.patch (obsolete) — Splinter Review
Sorry, I meant I changed it from 226s to 184ms http://people.mozilla.org/~dhardison/nytprof/bzapi-prof8/
Attachment #8791032 - Attachment is obsolete: true
That's awesome :-)
Flags: needinfo?(emorley)
Attached patch 1035804_1.patchSplinter Review
Attachment #8791039 - Attachment is obsolete: true
Attachment #8791256 - Flags: review?(dkl)
See Also: 1301541
Depends on: 1301741
Blocks: 1301144
Comment on attachment 8791256 [details] [diff] [review] 1035804_1.patch Review of attachment 8791256 [details] [diff] [review]: ----------------------------------------------------------------- r=dkl ::: extensions/BzAPI/lib/Util.pm @@ +95,3 @@ > my @new_groups; > foreach my $group (@{ $data->{groups} }) { > + if (my $object= Bugzilla::Group->new({ name => $group })) { if (my $object= Bugzilla::Group->new({ name => $group, cache => 1 })) {
Attachment #8791256 - Flags: review?(dkl) → review+
Summary: BzAPI compatibility layer bug query response takes 76s vs 6s for bzapi → BzAPI compatibility layer bug query response takes 76s vs 6s for rest
To git@github.com:mozilla-bteam/bmo.git ad29ade..3078746 master -> master
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Thank you for fixing this :-) I'd be interested to see some webhead stats in a few days to see whether this helped at all (though I guess likely lost in the noise, since presume you don't have per transaction type stats a la New Relic).
We have per request stats but there's too much noise because different requests take such drastically different times. There should be an overall improvement as more webheads are available to handle these faster requests.
Hopefully :-) (There isn't a Perl agent for NR, so it's somewhat a moot point, but this is the kind thing we have for Treeherder https://snag.gy/ALczOm.jpg)
Component: Extensions: BzAPI Compatibility → Extensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: