Closed
Bug 1350765
Opened 8 years ago
Closed 8 years ago
Calling TelemetryHistogram::Accumulate() even by HistogramID goes through hashtable lookup
Categories
(Toolkit :: Telemetry, defect, P2)
Toolkit
Telemetry
Tracking
()
RESOLVED
DUPLICATE
of bug 1366294
Performance Impact | low |
Tracking | Status | |
---|---|---|
firefox55 | --- | affected |
People
(Reporter: ehsan.akhgari, Assigned: chutten)
References
(Blocks 1 open bug)
Details
(Whiteboard: [measurement:client])
Attachments
(1 file, 1 obsolete file)
7.03 KB,
patch
|
chutten
:
review-
|
Details | Diff | Splinter Review |
Reporter | ||
Comment 1•8 years ago
|
||
Attachment #8851437 -
Flags: review?(chutten)
Reporter | ||
Updated•8 years ago
|
Assignee: nobody → ehsan
Assignee | ||
Comment 2•8 years ago
|
||
Comment on attachment 8851437 [details] [diff] [review]
Avoid recomputing the histogram ID when it's available in the caller
Review of attachment 8851437 [details] [diff] [review]:
-----------------------------------------------------------------
Saving cycles is fine by me!
Attachment #8851437 -
Flags: review?(chutten) → review+
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9b21aa70d85f
Avoid recomputing the histogram ID when it's available in the caller; r=chutten
Comment 4•8 years ago
|
||
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/b68e1c411057 because test_TelemetryHistograms.js and test_TelemetrySession.js would rather you not do that, https://treeherder.mozilla.org/logviewer.html#?job_id=86810740&repo=mozilla-inbound
Updated•8 years ago
|
Priority: -- → P3
Assignee | ||
Comment 5•8 years ago
|
||
Ack, yes, I forgot about addon-added histograms. They don't have IDs, which means that the control flow where getting an id fails, but you can still accumulate is indeed deliberate.
:Ehsan, you good to rework the patch (eventually)?
Flags: needinfo?(ehsan)
Reporter | ||
Comment 6•8 years ago
|
||
(In reply to Chris H-C :chutten from comment #5)
> Ack, yes, I forgot about addon-added histograms. They don't have IDs, which
> means that the control flow where getting an id fails, but you can still
> accumulate is indeed deliberate.
Ugh, I didn't even know add-ons get to add their own histograms. :-)
> :Ehsan, you good to rework the patch (eventually)?
Yeah, I presume we just want to preserve the previous behavior (which based on reading the code seems to be silently pretending that things are fine, but I'd like to run this under the debugger before judging too quickly) right?
I'll take a look at this again possibly next week though, I'm at a work week this week. I'll let the needinfo linger for now. Sorry for the lag in responding.
Reporter | ||
Comment 7•8 years ago
|
||
In order to fix this, we'd need to maintain the old code path that supports adding the histogram without having an ID for it in the parent process, but instead of having a conditional branch based on the hashtable lookup which can be slow, we can do that with some code duplication, which is a bit sucky but at least not as slow.
Flags: needinfo?(ehsan)
Reporter | ||
Comment 8•8 years ago
|
||
Attachment #8853756 -
Flags: review?(chutten)
Reporter | ||
Updated•8 years ago
|
Attachment #8851437 -
Attachment is obsolete: true
Assignee | ||
Comment 9•8 years ago
|
||
Comment on attachment 8853756 [details] [diff] [review]
Avoid recomputing the histogram ID when it's available in the caller
Review of attachment 8853756 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/components/telemetry/TelemetryHistogram.cpp
@@ +704,3 @@
> internal_HistogramAdd(Histogram& histogram, int32_t value)
> {
> + // We only really care about the dataset of the histogram if we are not recording
The corresponding conditional for this comment has been removed.
(And, as I discovered later, the conditional is required)
@@ +1394,2 @@
> internal_RemoteAccumulate(id, aSample);
> + } else if (XRE_IsParentProcess()) {
In the event we have a runtime-defined histogram but extended telemetry isn't enabled, I think this will allow recording. (which it shouldn't, see "bail out" case). Need a bail in internal_HistogramAdd(Histogram, int32_t) if !CanRecordExtended.
Sadly, the tests appear to be missing this particular case (runtime-defined addons with !canRecordExtended). Please add that case to test_addons.
Attachment #8853756 -
Flags: review?(chutten) → review-
Comment 10•8 years ago
|
||
(In reply to :Ehsan Akhgari (busy) from comment #6)
> (In reply to Chris H-C :chutten from comment #5)
> > Ack, yes, I forgot about addon-added histograms. They don't have IDs, which
> > means that the control flow where getting an id fails, but you can still
> > accumulate is indeed deliberate.
>
> Ugh, I didn't even know add-ons get to add their own histograms. :-)
We intend to remove the code for this, we should be able to remove the current code (see bug 1353295 for next steps).
It might help to wait with the patch here until after cleaning this up.
Reporter | ||
Comment 11•8 years ago
|
||
(In reply to Georg Fritzsche [:gfritzsche] from comment #10)
> (In reply to :Ehsan Akhgari (busy) from comment #6)
> > (In reply to Chris H-C :chutten from comment #5)
> > > Ack, yes, I forgot about addon-added histograms. They don't have IDs, which
> > > means that the control flow where getting an id fails, but you can still
> > > accumulate is indeed deliberate.
> >
> > Ugh, I didn't even know add-ons get to add their own histograms. :-)
>
> We intend to remove the code for this, we should be able to remove the
> current code (see bug 1353295 for next steps).
> It might help to wait with the patch here until after cleaning this up.
That sounds promising! I'll wait.
Depends on: 1353295
Updated•8 years ago
|
Whiteboard: [qf]
Updated•8 years ago
|
Whiteboard: [qf] → [qf:p1]
Reporter | ||
Comment 12•8 years ago
|
||
Now thanks to bug 1353295 the original patch can be relanded! \o/
Comment 13•8 years ago
|
||
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d31299b9b88e
Avoid recomputing the histogram ID when it's available in the caller; r=chutten
Comment 14•8 years ago
|
||
had to back this out because this conflict with https://hg.mozilla.org/integration/mozilla-inbound/rev/df0936e009668093aee2ad44b5764e4fbcb816c6 that got backout from m-c
After this backout we had x7 failures like https://treeherder.mozilla.org/logviewer.html#?job_id=91230487&repo=mozilla-inbound so we had to back this out
Flags: needinfo?(ehsan)
Comment 15•8 years ago
|
||
Backout by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3cd8e3b73309
Backed out changeset d31299b9b88e for conflicting with the backout in df0936e00966
Reporter | ||
Comment 16•8 years ago
|
||
Yeah I think the test failure when bug 1353295 got backed out is to be expected. :-(
Flags: needinfo?(ehsan)
Comment 17•8 years ago
|
||
Pushed by chutten@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1b7da41c6b3a
Avoid recomputing the histogram ID when it's available in the caller; r=chutten
Comment 18•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Comment 19•8 years ago
|
||
Ehsan, i don't see an r+ here. Did this get sign-off on IRC?
Flags: needinfo?(ehsan)
Assignee | ||
Comment 20•8 years ago
|
||
Oops, yes, sorry. The version that was submitted was r+ but failed because of addonHistograms. With the removal of addonHistograms it is that original patch that was pushed.
Flags: needinfo?(ehsan)
Reporter | ||
Comment 21•8 years ago
|
||
This is causing endless pain and misery. Now there is bug 1358259. There is also the possible Talos regression. I really don't have more time to spend on this. :-( Declaring defeat.
Also [qf:p1] was probably a tough sell in the first place. This does inflate the cost of telemetry collection for all places where people call Telemetry::Accumulate() where they pass a numeric ID but most of these probes are opt-in, so I'm hoping that somewhere in this code we are bailing out early in the release channel. It may be a good idea if someone can verify that at least...
Assignee: ehsan → nobody
Whiteboard: [qf:p1] → [qf:p3]
Reporter | ||
Comment 22•8 years ago
|
||
I'm backing this out.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Reporter | ||
Comment 23•8 years ago
|
||
(In reply to :Ehsan Akhgari (super long backlog, slow to respond) from comment #22)
> I'm backing this out.
https://hg.mozilla.org/integration/mozilla-inbound/rev/51ce1ce423df854f36b89a48ab96d98b09f881de
Comment 24•8 years ago
|
||
I'm picking this up for our work planning.
Thanks for getting this as far, we'll check into the fallout.
Priority: P3 → P2
Whiteboard: [qf:p3] → [qf:p3] [measurement:client]
Reporter | ||
Comment 25•8 years ago
|
||
Thank you!
Comment 26•8 years ago
|
||
backout bugherder |
Merged backout
https://hg.mozilla.org/mozilla-central/rev/51ce1ce423df
Status: REOPENED → RESOLVED
Closed: 8 years ago → 8 years ago
Resolution: --- → FIXED
Ugh, stupid bugherder...
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla55 → ---
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → chutten
Priority: P2 → P1
Updated•8 years ago
|
Points: --- → 3
Assignee | ||
Updated•8 years ago
|
Priority: P1 → P2
Comment 28•8 years ago
|
||
With the current state of bug 1366294, can we just dupe this bug against it?
Flags: needinfo?(chutten)
Assignee | ||
Comment 29•8 years ago
|
||
Sounds fair.
Status: REOPENED → RESOLVED
Closed: 8 years ago → 8 years ago
Flags: needinfo?(chutten)
Resolution: --- → DUPLICATE
Updated•3 years ago
|
Performance Impact: --- → P3
Whiteboard: [qf:p3] [measurement:client] → [measurement:client]
You need to log in
before you can comment on or make changes to this bug.
Description
•