For hot code paths, recording every accumulation from C++ directly into Telemetry may also not be ideal. Telemetry::Accumulate() is not very expensive, but it does have costs (locking, lookups). It can e.g. be more efficient to accumulate in a local variable and record the result into Telemetry afterwards. I will update the docs <https://gecko.readthedocs.io/en/latest/toolkit/components/telemetry/telemetry/collection/histograms.html> to make this clear.
Georg On Sun, Feb 12, 2017 at 10:22 PM, smaug <sm...@welho.com> wrote: > On 02/12/2017 08:52 PM, Jared Wein wrote: > >> The original email looks to be related to: >> https://bugzilla.mozilla.org/show_bug.cgi?id=1338891 >> and >> https://bugzilla.mozilla.org/show_bug.cgi?id=1338902 >> >> though I agree that the message could have been explained a little better. >> >> > Sorry about that. I thought the subject was clear enough :) > > But yes, don't implement probes as JS event listener when the event is > some rather commonly dispatched. > Same applies to observer service observers etc. > > Bug 1338902 doesn't have much to do with this. It is just about the > generic overhead probes add, also in C++. > Not very high overhead, but definitely measurable. So need to be careful > also in C++ what to measure and how. > > -Olli > > > - Jared >> >> On Sun, Feb 12, 2017 at 12:41 PM, Gijs Kruitbosch < >> gijskruitbo...@gmail.com> >> wrote: >> >> Can you clarify what you mean by "JS implemented" here? I was under the >>> impression the telemetry implementation was in C++... >>> >>> Separately, was there a concrete reason for you posting this warning? I >>> don't wish to shame people, but a concrete example of a 'wrong' pattern >>> might help in making it more obvious what exactly is problematic about >>> what >>> you're suggesting, and what should be done instead. >>> >>> ~ Gijs >>> >>> _______________________________________________ >>> dev-platform mailing list >>> dev-platform@lists.mozilla.org >>> https://lists.mozilla.org/listinfo/dev-platform >>> >>> > _______________________________________________ > dev-platform mailing list > dev-platform@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-platform > _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform