Power profiling with the Firefox Profiler
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Title of Series | ||
Number of Parts | 542 | |
Author | ||
License | CC Attribution 2.0 Belgium: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor. | |
Identifiers | 10.5446/61447 (DOI) | |
Publisher | ||
Release Date | ||
Language |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
|
FOSDEM 2023331 / 542
2
5
10
14
15
16
22
24
27
29
31
36
43
48
56
63
74
78
83
87
89
95
96
99
104
106
107
117
119
121
122
125
126
128
130
132
134
135
136
141
143
146
148
152
155
157
159
161
165
166
168
170
173
176
180
181
185
191
194
196
197
198
199
206
207
209
210
211
212
216
219
220
227
228
229
231
232
233
236
250
252
256
258
260
263
264
267
271
273
275
276
278
282
286
292
293
298
299
300
302
312
316
321
322
324
339
341
342
343
344
351
352
354
355
356
357
359
369
370
372
373
376
378
379
380
382
383
387
390
394
395
401
405
406
410
411
413
415
416
421
426
430
437
438
440
441
443
444
445
446
448
449
450
451
458
464
468
472
475
476
479
481
493
494
498
499
502
509
513
516
517
520
522
524
525
531
534
535
537
538
541
00:00
Potenz <Mathematik>Content (media)Computing platformInternet service providerProfil (magazine)Potenz <Mathematik>Computer fontInformationMultiplication signComputer animation
00:37
Sample (statistics)Source codeStack (abstract data type)Programmable read-only memoryStructural loadPerformance appraisalHand fanLaptopPerspective (visual)Product (business)Multiplication signTerm (mathematics)Point (geometry)Greatest elementOffice suiteNetwork topologySemiconductor memoryFamilyType theorySet (mathematics)Level (video gaming)Machine visionTheory of relativitySoftwareQuantumUser interfaceWeb applicationSource codeTrailCommitment schemeStack (abstract data type)Computer programmingOpen setReading (process)Uniform resource locatorProduct (business)Motion captureShared memoryPlastikkarteCategory of beingInternet service provider2 (number)Row (database)Web browserProfil (magazine)SpeicheradresseComputer iconDefault (computer science)Goodness of fitHand fanPotenz <Mathematik>LaptopHome pageWebsiteSampling (statistics)Different (Kate Ryan album)Nichtlineares GleichungssystemMereologyComputer animation
04:56
Distribution (mathematics)TrailComputerBefehlsprozessorAverageGraphics processing unitGraphical user interfaceComplex (psychology)Sampling (statistics)Potenz <Mathematik>Euclidean vectorMeasurementDevice driverWeb browserPairwise comparisonMetreFood energySurfaceDatabase normalizationIntelInterface (computing)UsabilityExecution unitLatent heatInstallation artComputer hardwareDynamic random-access memoryCore dumpComputing platformProcess (computing)ImplementationMagnetic stripe cardEvent horizonKernel (computing)Product (business)Potenz <Mathematik>NeuroinformatikLocal ringGreatest elementWebsiteComputer hardwareSurfaceMetreVirtual machineBefehlsprozessorComputer architectureDifferent (Kate Ryan album)Direction (geometry)Latent heatRevision controlProfil (magazine)TrailAdditionFood energySoftwareSemiconductor memoryPrototypeWindowPoint (geometry)Traffic reportingMultiplication signOpen sourceAssembly languageSide channel attackAverage2 (number)Event horizonSoftware testingLimit (category theory)RootSoftware bugExecution unitRow (database)Device driverKernel (computing)Task (computing)VideoconferencingCartesian coordinate systemBit rateSource codeProjective planeBitPhysical systemMilitary baseSystem callNumberFinite-state machineCondition numberMatching (graph theory)Internet service providerComputer animation
12:19
Potenz <Mathematik>Configuration spaceThread (computing)Inclusion mapRow (database)Process (computing)BefehlsprozessorProgrammable read-only memoryEntire functionOverhead (computing)InformationUser profileChannel capacityHome pageCursor (computers)Address spaceElectric currentFood energyRange (statistics)Asynchronous Transfer ModeLimit (category theory)Drop (liquid)Core dumpTerm (mathematics)Inheritance (object-oriented programming)Web pageVirtual machineWebsiteProfil (magazine)Configuration spaceLimit (category theory)Virtual machinePotenz <Mathematik>Multiplication signSlide ruleWindowData managementSystem callGreen's functionComputer iconAnalogyLaptopWeb pageOverhead (computing)Sampling (statistics)Active contour modelLink (knot theory)InternetworkingBand matrixStability theoryProcess (computing)NeuroinformatikTrailDistanceCursor (computers)Address spaceAsynchronous Transfer ModeBroadcasting (networking)Expected valueEvent horizonSoftware testingStack (abstract data type)MereologyHome pageRange (statistics)Operating systemSurfaceBefehlsprozessorTask (computing)Food energyRing (mathematics)Key (cryptography)Basis <Mathematik>Chromosomal crossoverLevel (video gaming)Musical ensembleTouchscreenCASE <Informatik>Internet service providerCategory of beingSoftware developerInterrupt <Informatik>Latent heatPoint (geometry)Discounts and allowancesResultantWave packetTouch typingElectric generatorTheory of relativityView (database)Medical imagingCausalityMachine visionMathematicsInternet forumStudent's t-testComputer animation
19:26
Virtual machineBefehlsprozessorOverhead (computing)Task (computing)Thread (computing)Process (computing)Electric currentFood energyRange (statistics)Matrix (mathematics)Process (computing)BefehlsprozessorProfil (magazine)Overhead (computing)Thread (computing)InformationVirtual machineOperating systemWeb pageUser interfaceTrailResultantComputer hardwareMetreKernel (computing)Presentation of a groupFrequencyOperator (mathematics)Core dumpTask (computing)Latent heatEquivalence relationBitPotenz <Mathematik>SoftwareShape (magazine)NeuroinformatikType theoryVideo game consoleMultiplication signSet (mathematics)Data managementSlide ruleTerm (mathematics)LaptopIntrusion detection systemAdditionLine (geometry)2 (number)Principal ideal domainContext awarenessPoint (geometry)Game controllerDifferent (Kate Ryan album)Software testingMedical imagingGreatest elementLink (knot theory)CryptographyLoop (music)AlgorithmAnnihilator (ring theory)WebsiteShared memoryInternet service providerWordNumberDisk read-and-write headBridging (networking)SpacetimeTouchscreenMeasurementGoodness of fitTablet computerDesign by contractOffice suiteService (economics)CASE <Informatik>View (database)Wave packetPhysical systemEndliche ModelltheorieSystem callServer (computing)Computer animation
26:33
Execution unitForm (programming)Physical systemProfil (magazine)Logical constantDecision theoryFood energyMusical ensembleDegree (graph theory)Multiplication signMultiplicationBootingRight angleAlgorithmRow (database)outputDifferent (Kate Ryan album)Operating systemBit rateSide channel attackCryptographyComputer animation
27:44
Program flowchart
Transcript: English(auto-generated)
00:05
Hello, everybody. I will be talking about power profiling with a Firefox profiler. And Chris mentioned it briefly, but I will go in many more details about how this works. So the outline of the talk, I will first explain what the Firefox profiler is,
00:20
because I don't want to assume that everybody knows. And then I will go into the topic, which is explain why we care about this, how this thing happens, where we support it, and show examples of which kind of information it gives us. And if I have some time left, I have a few more things I could share. So what's a Firefox profiler? You can find it as a web application at this address.
00:43
It's a built-in profiler inside Firefox web browser. And by built-in there, I mean that the part that collects the data is inside the web browser itself. And the place where you see the data is a web application. It was initially created for performance work,
01:01
especially when Mozilla and Firefox started caring a lot about making things go fast, because our competition said that they were faster and we could compete on that. So especially for Firefox 57, Firefox Quantum, we worked a lot with the profiler. And the question was always, why is this thing so slow?
01:20
Can we make it faster? Over time, it had expanded, and now we can use it for many more things, a lot of debugging. It's a great way to get data about what a piece of software is doing. And it has multiple sources of data, but the two main sources are sampling, which is we have a timer. And at a fixed interval, we interrupt the program
01:41
and capture data by getting stacks of threads, for example, while also getting the values of counters, for example, counting memory locations. And the other thing is markers, where we just record what happened at any specific point in time. And this is useful for things that happened very quickly, but we still want to see.
02:00
So if you want to get started with your profiler, as I said, you go to this address. There you click the big button, enable Firefox profiler. You get this that appears. Basically, clicking the button just made the toolbar icon appear here on your browser, but you could also find it by customizing the toolbar. Then you can customize the preset. Here it says nightly.
02:22
It's a good default for general profiling. And then you can start recording. It will show something like this. Then you can do whatever you would like to measure, for example, loading a website. Very often, people would like their website to load faster, so that's a good example. Do it, and a few seconds later, when you click the capture button, you will see something like this in a tab that appears.
02:42
So here what I profiled is loading the Wikipedia homepage. And we can see there's many things in the user interface. It might be a little bit overwhelming at the beginning, but we get used to it very quickly. You can move the marks around, and there will almost always be a tool tip like this that explains what you are looking at.
03:01
So first half here is what we call the timeline. It's things happening across the time. We can see markers. It's those small things here that we noted. Those are network requests, but also some kind of markers. And here we are hovering here on this yellow thing. And we see here the stack of what we are hovering.
03:21
The stack includes JavaScript, C++. You can know everything about what was happening at this time. And then there's the bottom half. That's showing data in various different ways. Here the cool tree is just showing what the samples look like. This is a memory counter here. So counter just counting how many equations we did.
03:44
And we also have markers here in a marker chart where we can see actually which network request we did. So this is a tool again that we developed to make things faster. Then we will see how we can use it to make things more efficient. So now we'll talk about power profiling.
04:02
And first, say why we care about this. Why we care, and also why do I care? So my work at Mozilla is to make Firefox more efficient, to understand how it uses power, and reduce the power we use. And there are two main sets of reason. First one is still performance, because resource use is still a performance topic.
04:20
And users care about power use, actually, because the fan is noisy, the laptop is too hot to type on, or the battery life is too short. So all very good reasons, but at the individual level. And we also care at a more global level for sustainability. Mozilla made climate commitments. Some interesting things I will mention here
04:41
is that we want to lead openly and share our tools, and improve our products from a sustainability perspective. So sharing the tools, this is what I'm doing with the power profiling stuff. The reason why we want to improve our product is that when we did a greenhouse gas assessment for Mozilla, turns out the use of our product is 98%.
05:01
That should not really be a surprise. We have a product that's used by multiple hundred millions of people. So anything else we do, even if it's not clean, it's still a tiny portion. So power profiling is to understand the local power use of Firefox, our website, and a computer that's typically in front of us.
05:25
And I will explain the journey I followed to try to understand how much power we are using. So the first step was, OK, I know what we are doing. I know how much CPU we are using, but I have no idea what that means in what, and where we can save power. And the first step was to buy one of those what methods that are always recommended
05:41
for people who want to save energy by figuring out how much power is used by what in their house. It's easy, it's affordable, pretty accurate, but not that useful for software, because you can't track what happens over time. Then I found something better. It's still a what method, but it's sending data to a computer over Bluetooth. There I can see the history of what happens.
06:02
It's much better, but still, how do I match this with what actually happened? I need to remember what I did. It's not as convenient. Maybe I could record a video of what happens on the computer, but still, it's painful to use. And I kept wondering, what are other people doing? And then I found this article by Microsoft. They were very happy to say that Edge
06:21
was the most efficient in bragging about it. And blah, blah, blah, blah, blah, blah. One sentence caught my attention. Power was measured on the Surface Book, so Microsoft device, because it has integrated hardware instrumentation. So what Microsoft did is they built their own computers with instrumentation so they could measure how much power is being used. And they explained about what this thing is.
06:41
Can I get one of those machines? Sure. They are old. They were released in 2015. So getting old now, but we can still play with those. So one of those machines is what they use when they compare Edge with everything else. And the way they looked at it was with the Windows
07:01
Performance Monitor. So it's this application here. And we can see, indeed, that I have power for the battery, CPU cores, GPU, and the Wi-Fi. Very interesting. And I looked for more recent devices. I spent multiple weeks searching for devices that might have those power meters, because that was very interesting.
07:21
And the devices in the picture here, they are the only two that I found that actually have working power meters. And they are both Microsoft Surface devices. This is what the UI looks like if you look at the Windows Performance Monitor. So those things, they are here. And they report data and its numbers.
07:40
Good luck if you understand what that means. I have no idea. Well, I do have some idea, but it took a while to understand. And then I had a good surprise. I noticed on some machines that there were those things reported as energy meters. And the names are pretty familiar. They are the same names that we see if we use a piece of software called Intel Power Gadget that reports the power used by the CPU and integrated
08:03
GPU and those kind of things. And after some correlation, I realized that all the machines on which I noticed this were running Windows 11. And they all had Intel CPUs. And I verified this because I found a Windows 10 machine. It didn't have this.
08:20
I updated to Windows 11, and then those things appear. So it's really Windows 11 that brought those things. Intel CPUs are recorded as power meters. And the very nice thing is there's a documented API to use those power meters. It's probably used by perf monitor or something like that, the UI I don't want to use. But with the documentation, I could understand how to make use of this.
08:41
What the unit was, Pico, whatever. So that was the answer. And we can create many times per second. It doesn't have to be only once per second. And it's accessible in user alone, which is something I care a lot for Firefox because I don't want people using Firefox as root or things like that. That would be absolutely terrible.
09:01
And no requirement to install a specific driver. Before that, in our test infrastructure, when we were interested in measuring power, we installed Intel Power Gadget. But we don't want to require users to do that. And it's not open source. So I started working on a prototype to include this in the Firefox profiler because, as I said, we record counters, memory counters.
09:22
And it looks like this API is totally usable for profiler counters. And this is the bug where I worked on it. And this is the first prototype I got. So the names, they match what we saw. And then we have those power tracks in addition to memory counters, network traffic, and all the other stuff. And it actually looked pretty reasonable.
09:40
So this is a profiler of Firefox starting up. So we use a lot of CPU at startup and then almost nothing because we are done starting up. And here, this is the CPU being used. And here, this is the GPU. We use it at the beginning when we start showing something. And then only every once in a while, pretty reasonable. So I kept working on it and polished it enough that it would really work and be something
10:01
we'd be happy to ship. So the prototype now will say where it actually works, where we managed to get it working because that's not everywhere. But still, it's almost everywhere at this point. It works on Windows 11 on those specific devices I mentioned before. It works on Windows 10, sorry.
10:22
It works on Windows 11 with Intel CPUs. And I've recently had reports that with AMD CPUs, it started working. I don't know exactly when, but I suspect it's with this update. And I will try to verify soon. And one thing that's very interesting with AMD CPU is that we have one power track per core, which might let us make much better creation about what's
10:42
actually using the power. Mac, two different architectures on Mac, mostly undocumented or poorly documented API. Poorly documented means the name of the API is there. There's no explanation about what it does or how to use it. But the kernel is open source.
11:01
So by reverse engineering a little bit, I could figure out that this task energy thing was a value in nanojoule. And for Intel CPUs, specifics is called called with magic assembly code that we had implemented eight years ago I didn't know anything about, but someone pointed me to it. Great. We can also support Intel Macs.
11:21
And then Linux. So on Linux, we can use REPL perf events. So REPL is running average power limit. It's the data that's reported by Intel CPUs. One issue in Linux is the data is not available as a user. And the reason is that it used to be available directly. And there was a side channel attack
11:41
where people noticed that by querying power use very repeatedly, they could actually figure out what data was being processed. The way they addressed it was to restrict the access. So you need to run this before starting power profiling. And it's actually the same command that you need to run to run Linux perf to profile
12:01
in general on Linux. So it's probably fine. As long as it's just this and I don't require Firefox to be run as root, I think it's OK. MDCPUs are supported since new version of the Linux kernel, but it's a few years old at this point. Probably fine. And if you try it, it doesn't work on Ubuntu Firefox snap
12:23
packages. But if you download Firefox on the Mozilla site and don't use the snap package, it works on Ubuntu too. Here's how you configure it. So I showed the profiler UI before where you could use the nightly preset. I said it was fine for most cases. If you want to profile power, we
12:42
have a power preset that's configuring the profiler. The two thing it does is enabling power profiling. So with this feature we have here in the configuration page. And the other thing is adjusting the configurations to reduce the amount of overhead. Because if we have a lot of profiler overhead, the things we'll see in the profile will be meaningless. And actually, we already tried to do power profiling
13:02
a couple years ago. That was supposed to be a picture here. That's strange. I see the picture on my screen, but it's not here. So I was saying we are afraid that the profiler overhead would make it impossible to get any useful data out
13:20
of power profiles because the profiler is actually using a lot of power itself to interrupt some of the stacks and all that thing. So we can reduce that overhead by using longer intervals between samples and ensuring that when we sample, we only capture the values of the contours and not the actual stacks. Oh, it appeared quickly.
13:42
So yeah, we see the features here that were enabled. Power profiling, markers for all threads, sampling every 10 milliseconds instead of every 1 millisecond. Now that I explain how we got this power profiling thing, I will show examples of what it looks like when a power profile is something.
14:01
So loading Wikipedia homepage again, this time with the power profiling preset, and we can see exactly how much power was used by the content process loading Wikipedia. So we can select a range here, and we see in the tooltip how much power was used by this process during that amount of time. This profile is captured on Mac, so we
14:21
have a track per process. Another example, by the way, the profiler is very easy to explore by looking and moving the mouse around and looking at the tooltips. It's not so great for screenshots, so all my slides include a link to the profile that I'm showing. So if you want to look at the slides later and click
14:41
the links, that will be a lot more fun for you, I think. This time it's Firefox startup, Windows 11. And we can see how much power was used by starting Firefox here, by the CPU. So we can see it here. And this is an example I really like, because it's really pushing the limit of what we can profile.
15:02
I had never thought we could profile this, especially when I was afraid about the overhead. But if we profile a profile, we see that when we do nothing with Firefox, literally nothing, like I was profiling Firefox about blogs, so literally nothing, no websites, the one thing that's left is the cursor that blinks in the address bar.
15:22
Every 500 milliseconds, there's a power spike. And we can see exactly how much power it uses to show or hide the cursor in the address bar. So yeah, very detailed. And then I will show some examples where we use power profiling to validate fixes we've done. So this is something we did specifically for Windows 11.
15:42
They have a new feature that they call efficiency mode. And it's visible in the task manager by looking at this icon here, this green leaf thing. Looks a lot like green racing, but it actually does something. It means we let the operating system know that this process is doing nothing that the user cares about immediately,
16:02
because it's probably invisible. It's probably in the background. What we want, instead of doing the work as fast as possible, is do it with as little energy as we can. It's typically doing this by doing two different things. One is ensuring we use the lowest possible CPU frequency, which uses less power.
16:20
And the second thing is on hybrid CPUs that have both efficiency and performance scores, always use efficiency scores. And this profile was captured on a modern Intel laptop. So we have an analog CPU with efficiency scores. And this is a web page that I did for testing. It's using 100% of the CPU, just a busy loop,
16:42
but there's nothing except burning CPU. The process here is in the foreground. Here we see a process priority change, because we go into the background. And here you see how much power we use. It's about 10 watts for the CPU, and it's down to two. So we divide it by five power used by just ensuring that we let Windows know that this process is
17:02
for something in the background, don't worry about speed. And things actually run slower, by the way, but use less power. And then I have a few fun examples of things that were. So the previous example, we have stuff where it actually works, and power profiling was useful to show the stuff we cared about.
17:20
And I wanted to share a few funny examples of things I absolutely didn't expect. This profile is from one of the Microsoft Surface machines I put before in the picture. And I said we profiled the CPU, the GPU, the Wi-Fi chip there. And that's the only machines where I can profile the power used by the Wi-Fi.
17:41
And I noticed that Wi-Fi's chip overuse is almost always half a watt, so 500 milliwatts there, when the machine is plugged to a charger. And what happened here is I unplugged the charger. There was a poor broadcast event. And now we only use power when there's probably in-network traffic.
18:01
And I had no idea that Windows was doing this. I think it's to reduce latency, but it keeps the Wi-Fi chip alive all the time. More Wi-Fi profiling, because CPU profiling, you can do all you like, because it's easy to do. Wi-Fi profiling, you need specific hardware, so I will share the fun.
18:20
This time I was power profiling what it looks like to do a bandwidth test. So it was the website speedtest.net. It's a single profile. There's a link here. But I zoomed on two different parts of the profile. The top half is when I actually ran the test on the machine. So we still use 500 milliwatts here.
18:41
And we have peaks that go up to two watts of a Wi-Fi chip. We push it to the limit. It was actually not really testing the bandwidth of my internet connection, more the Wi-Fi chip of that machine. And the second chart is I did the exact same tests, but on this laptop that was on the same desk. And here, it's stable at the beginning, 500 milliwatts,
19:03
stable at the end. And for about the same duration, we have almost the same shape, but it only goes up to 700 milliwatts or 800 milliwatts. So we can see that just if there's computers in the room of very close proximity that use the Wi-Fi, it looks like there's more Wi-Fi packets
19:20
that the machine needs to discard because they are not meant for this machine to get. And that actually uses power. And I think we can actually look at network traffic by looking at how much power is used on the Wi-Fi. And when I tried to get this, I was getting very confused results. And then I realized someone was trimming something in a different room in the house on the same Wi-Fi network.
19:40
So we closed that computer, and then I got better screenshots. And yes, also when I worked on that, I put wired network on all the other computers on my office. Otherwise, it was a mess. And another one that's still puzzling to me, I said on Mac we have a power track per process. And I don't exactly know how they do it, but I suspect it's because they control both the CPU
20:02
hardware and the kernel. And I suspect what they do is they have a power meter internally for each core. And whenever they context switch, they very likely take the value of the control at this point. So they can know exactly how much power is used by each process. And this example, I still can't explain. So I was using a test web page again
20:21
that's using 100% of the CPU core. And we see it's using four watts. By the way, it's three different screenshots that I imagine to one so that you can see different tool tips, but yeah, if it's not perfectly aligned, it's because I'm not so good at image editing. So using four watts here with a process that's just burning CPU. And then the other processes, they do literally nothing.
20:40
So you will have to trust me on this or look at the profile. But I looked in the marker chart, there's literally nothing. The threads don't wake up. So the only thing we are profiling here is the actual power overhead of a profiler. And if you compare the numbers, we are talking about four watts here, two milliwatts here, it's probably fine. Profiler overhead is probably not distorting too much information.
21:01
But the one thing that's really strange is when you start burning CPU here, a few milliseconds later, the power overhead of a profiler drops dramatically, about 10 times lower. I still don't have the correct explanation for this. I have ideas about what it could be. I suspect it is that when we are actually busy with a CPU, the operating system uses a higher frequency.
21:24
So it's likely that it's actually correct and it's just we are using a CPU at a higher frequency here. So the same operations took more power. But I'm not sure, it's just a guess. Yeah, there are lots of possible explanations,
21:42
but I don't have a way to conclude about what the thing actually is. Another idea was we also have efficiency cores on those machines. It could be that we are switching to efficiency cores, but I'm not sure it's a good explanation, especially given I have that many processes and only two efficiency cores. So yeah, I don't know, but it's fun things to look at in profiles.
22:03
And if I have a few more minutes, I have three more slides. One thing I wanted to share is the Firefox Task Manager. Very often when you care about power profiling, it's because something is using too much power on your Firefox. And the good way to look at it is to look at the Task Manager here. That will give you all the processes used by Firefox,
22:21
but in addition to showing just the process IDs and how many percent of the CPU it's using, it will tell you which tabs are loaded in which process. So you can figure out if you want to close a specific tab that's using too much. But also, there's this profiler button here that appears when you hover the line next to the PID. If you click it, five seconds later,
22:40
you get a profiler tab with everything that happened in that process. So in most cases, you just need to close a tab because you have one tab in the background that you don't care about that's doing crazy stuff. But if something really looks not the way it should be, you can do one-click profiling. And if your machine supports power profiling, the power tracks will be there.
23:01
Another thing I wanted to mention, it was also visible a little bit in Chris' presentation, but I worked on power profiling. I didn't work on adding the CO2 equivalent. This was a very welcome contribution from Chris and Thirshad from the Green Web Foundation. We are very happy about that. And the last thing I wanted to share here.
23:20
So I explained all of this presentation how great it is to power profile. And I will explain why you don't really need it. In most cases, what's using most of your power is the CPU. And without power profiling, we can already profile CPU use. So we have CPU use per thread here. That's how we make the shape here. But sometimes we don't look at all the threads at once
23:41
and something else might be using power or CPU. And we also record the CPU for the entire process. It's also a counter, so we cut it in the same way. We don't show it by default because we're not too sure about the user interface we want to put for it. But you can access it from the DevTools console here. You type experimental enable process CPU tracks.
24:00
And you see those process CPU tracks that appear here. And the shape, they are extremely similar. Usually there are slight differences, mostly when we use the GPU a lot. Like the shape is slightly different here, slightly different here. Overall, it's mostly the same. And CPU profiling you can get on all machines.
24:23
That's all I wanted to share for today. If you have, first, thanks for your attention. If you have a question, I think we have a little bit of time.
24:46
We're public. Is there any data set underneath the screenshot publicly? I didn't. Measurement, do you see what I mean? So the question was, you said the screenshots are public.
25:01
Is there any data set that's also public? So I didn't say the screenshots are public. I said the profiles are public. And there's a link at the bottom of the slides to open the profiles. Profile other. Yeah, but you can really get your own profile. And it's a lot more fun when you profile something you actually use on your own computer.
25:22
Tip two, typical, as you said, blank page, linking process, until typical very bloat website, and then try to make a loop back to the website builder, give them information about what is significant.
25:43
Okay, so it was more common than a question. It would be useful to publish examples of what's using power. One thing I should have probably mentioned is that when looking at the power numbers, they don't mean a lot in terms of what your actual users will experience, because the typical power use of a computer varies a lot.
26:01
Some of the machines I was showing in the picture, they have four-watt CPUs. Some people have 200-watt CPUs. The most common, because we also have telemetry at Mozilla, and we look at the power use of our user's CPU, the most common CPU power is 15 watts. That's typical for laptops. And the second most power is 65.
26:20
And that's typical for desktop machines. If it's detailed enough to verify that constant-time crypto algorithms are also constant-energy crypto algorithms. Should I repeat?
26:40
Yes, please. So the question was, is it precise enough to verify if constant-time crypto algorithm are also constant-energy user algorithm? If you can run the algorithm multiple times in a row long enough that you can power-profile it, maybe. So we need to run it many times with different inputs.
27:01
I'm not completely sure, honestly, but you can try. And the sampling rate that we get is at most every millisecond on some operating systems. And the issue I mentioned about the side-channel attack. So on Linux, it was worked around by making it restricted access. On other platforms, the way they work around it is by ensuring we don't access it
27:21
more than once every millisecond. So if we access it more than once every millisecond, we get the same data again. So you can't power-profile more than every millisecond. Thanks.