{"id":194,"date":"2021-07-08T08:32:26","date_gmt":"2021-07-08T15:32:26","guid":{"rendered":"https:\/\/blog.mozilla.org\/performance\/?p=194"},"modified":"2021-07-09T09:03:42","modified_gmt":"2021-07-09T16:03:42","slug":"performance-tools-newsletter-h1-2021","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/performance\/2021\/07\/08\/performance-tools-newsletter-h1-2021\/","title":{"rendered":"Performance Tools Newsletter (H1 2021)"},"content":{"rendered":"<p>As the Perf-Tools team, we are responsible for the <a href=\"https:\/\/profiler.firefox.com\/\">Firefox Profiler<\/a>. This tool is built directly into Firefox to understand the program runtime and analyze it to make it faster. If you are not familiar with it, I would recommend <a href=\"https:\/\/profiler.firefox.com\/docs\/\">looking at our user documentation<\/a>.<\/p>\n<p>If you are curious about the profiler but not sure how to get to know it, I\u2019ve also given a <a href=\"https:\/\/fosdem.org\/2021\/schedule\/event\/webperf_firefox_profiler\/\">FOSDEM talk<\/a> about using the Firefox Profiler for web performance analysis this year. If you are new to this tool, you can check it out there.<\/p>\n<p>During our talks with the people who use the Firefox Profiler frequently, we realized that new features can be too subtle to notice or easily overlooked. So we&#8217;ve decided to prepare this newsletter to let you know about the new features and the improvements that we\u2019ve made in the past 6 months. That way, you can continue to use it to its full potential!<\/p>\n<h2>Table of Contents<\/h2>\n<ol>\n<li><a href=\"#new-features\">New features<\/a>\n<ol>\n<li><a href=\"#enabled-dev-edition\">Enabled the new profiler recording panel in Dev Edition<\/a><\/li>\n<li><a href=\"#cpu-utilization-visualization\">Visualization of the CPU utilization<\/a><\/li>\n<li><a href=\"#sample-graph\">Sample graph to show the samples\u2019 position in the timeline<\/a><\/li>\n<li><a href=\"#delete-button\">Delete button on the profile viewer page<\/a><\/li>\n<li><a href=\"#stack-category-color\">Stacks now include the category color of each stack frame<\/a><\/li>\n<li><a href=\"#rust-profiler-api\">Profiler Rust API for thread registration has landed<\/a><\/li>\n<li><a href=\"#internationalization\">Firefox Profiler Analysis UI is now internationalized<\/a><\/li>\n<li><a href=\"#screenshots-while-selecting\">Screenshots are now visible while selecting a time range<\/a><\/li>\n<li><a href=\"#android-trace-format-support\">Android Trace format support<\/a><\/li>\n<li><a href=\"#profiler-category\">\u201cProfiler\u201d category showing the profiler overhead<\/a><\/li>\n<li><a href=\"#show-all-tracks\">\u201cShow all tracks\u201d button in the timeline tracks context menu<\/a><\/li>\n<\/ol>\n<\/li>\n<li><a href=\"#improvements\">Improvements<\/a>\n<ol>\n<li><a href=\"#better-network-markers\">Better network markers<\/a><\/li>\n<li><a href=\"#jit-stack-walking\">Better stack walking around JIT<\/a><\/li>\n<li><a href=\"#marker-context-menu\">Better marker context menu<\/a><\/li>\n<li><a href=\"#markers\">Marker improvements<\/a>\n<ol>\n<li><a href=\"#new-markers\">New markers<\/a><\/li>\n<li><a href=\"#marker-fixes-improvements\">Fixes &amp; Improvements<\/a><\/li>\n<\/ol>\n<\/li>\n<li><a href=\"#chromeutils-addprofilermarker\">Capturing a stack and adding category support for the JavaScript <code>ChromeUtils.addProfilerMarker<\/code> API<\/a><\/li>\n<li><a href=\"#network-track-tooltips\">Tooltips in the network track<\/a><\/li>\n<li><a href=\"#profile-info-button\">Made the Profile Info button more explicit<\/a><\/li>\n<li><a href=\"#android-device-info\">Android device information inside the Profile Info panel<\/a><\/li>\n<li><a href=\"#zip-file-viewer\">Zip file viewer now automatically expands all the children<\/a><\/li>\n<li><a href=\"#xpidl-label-frames\">New label frames for XPIDL method\/getter\/setter calls<\/a><\/li>\n<li><a href=\"#profiler-memory-track\">Profiler buffer memory is no longer counted in the profiler memory tracks<\/a><\/li>\n<li><a href=\"#network-chart-accessibility\">Improved accessibility in the Network Chart<\/a><\/li>\n<li><a href=\"#removed-ifdefs\">Removed many MOZ_GECKO_PROFILER ifdefs<\/a><\/li>\n<\/ol>\n<\/li>\n<li><a href=\"#whats-next\">What\u2019s next?<\/a><\/li>\n<li><a href=\"#conclusion\">Conclusion<\/a><\/li>\n<\/ol>\n<p>So, let\u2019s get started with the new features.<\/p>\n<h2 id=\"new-features\">New features<\/h2>\n<h3 id=\"enabled-dev-edition\">Enabled the new profiler recording panel in Dev Edition<\/h3>\n<p>In the DevTools panel, we still had the old performance tab. That tool was pretty old and not very well maintained for a while. The new Firefox Profiler is a lot more comprehensive compared to the old tool. We aim to make it the new default one. We\u2019ve hit a big milestone and enabled it in the Firefox Dev Edition. We are hoping to get rid of the old panel soon. Thanks to Nicolas Chevobbe and Julian Descottes from the DevTools team for helping out on this!<\/p>\n<h3 id=\"cpu-utilization-visualization\">Visualization of the CPU utilization<\/h3>\n<p>Previously, the height of the activity graph (the graph in the pictures) wasn&#8217;t directly tied to the actual amount of work done: We were setting the height to 100% when we saw a non-idle sample there, and then applying some smoothing. But now, we collect the CPU usage information from Firefox and then draw the height of this graph to match the CPU usage of this thread. This allows our users to see which part of the thread is using more CPU and which part of the thread is using less. This is important because our users were thinking that the height actually meant CPU usage already, but it wasn\u2019t the case before. So, it\u2019s good to match our users\u2019 expectations in this case.<\/p>\n<p>This new implementation also gives us information about the places where the Firefox is unresponsive but the thread is not using any CPU. In this case, it can mean that the thread is blocked.<\/p>\n<p>When the graph height is not so high, except waiting for another thread, it can also mean that, either the thread is waiting on disk to write\/read a lot, or the whole system is working on a heavy task and not giving Firefox enough CPU time to run.. Previously, it wasn\u2019t possible to figure these cases out, but thanks to the CPU usage information, we can now understand it by looking at a profile.<\/p>\n<p>Here are two example profiles. Both are from a startup of Firefox, but the first one is a warm startup, whereas the second one is a cold startup. You will notice easily that the graph height on the cold startup is a lot lower compared to the warm one. This is because on cold startups, we are reading a lot of data from the disk, and the reference laptop we used to capture these profiles has a slow disk:<\/p>\n<ul>\n<li aria-level=\"1\"><a href=\"https:\/\/share.firefox.dev\/3lrhuVa\">Windows 10 &#8211; Fast Reference Laptop &#8211; Warm Startup<\/a><\/li>\n<li aria-level=\"1\"><a href=\"https:\/\/share.firefox.dev\/3qPml3O\">Windows 10 &#8211; Fast Reference Laptop &#8211; Cold Startup<\/a><\/li>\n<\/ul>\n<div id=\"attachment_195\" style=\"width: 810px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-195\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-195 size-full\" src=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/cpu-usage.png\" alt=\"You can see the new radio button with &quot;Categories with CPU&quot; in the top left corner of Firefox Profiler\" width=\"800\" height=\"352\" srcset=\"https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/cpu-usage.png 800w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/cpu-usage-300x132.png 300w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/cpu-usage-600x264.png 600w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/cpu-usage-768x338.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><p id=\"caption-attachment-195\" class=\"wp-caption-text\">Now we have \u201cCategories with CPU\u201d as a graph type. You can see that the graph is different now when CPU usage numbers differ.<\/p><\/div>\n<h3 id=\"sample-graph\">Sample graph to show the samples\u2019 position in the timeline<\/h3>\n<p>With the previous CPU utilization work, we also added another graph underneath the activity graph. As visible in the image below, you can now see the exact locations of the samples in this graph. You can also click on them to select that sample\u2019s stack. With this graph, it\u2019s also possible to see where we have missing samples. Missing samples usually mean that the profiler can\u2019t keep up with the sampling. It\u2019s good to note that we don\u2019t know exactly what\u2019s happening in these areas of the timeline. You can try to reduce the overhead of the profiler if you have so many missing samples, for example by increasing the sampling interval, because the profile data you captured will not be as reliable when the profiler can\u2019t sample regularly enough.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-196\" src=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/sample-graph.png\" alt=\"Sample Graph can be found at the bottom of the activity graph in the timeline\" width=\"966\" height=\"172\" srcset=\"https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/sample-graph.png 966w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/sample-graph-300x53.png 300w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/sample-graph-600x107.png 600w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/sample-graph-768x137.png 768w\" sizes=\"(max-width: 966px) 100vw, 966px\" \/><\/p>\n<h3 id=\"delete-button\">Delete button on the profile viewer page<\/h3>\n<p>You can find it inside the \u201cProfile Info\u201d popup on the top right corner if you uploaded that profile. Previously we added <a href=\"https:\/\/profiler.firefox.com\/uploaded-recordings\/\">this page<\/a> to manage your uploaded profiles. But adding the delete button to the analysis UI was also important, so you can directly delete the profile that you easily uploaded. We keep a key in your browser\u2019s local storage to know that you uploaded that profile data. So, to be able to delete it, you need to use the same browser that you uploaded it from.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-197\" src=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-delete-button.png\" alt=\"Profile delete button can be found inside the &quot;Profile Info&quot; panel at the top right corner.\" width=\"501\" height=\"243\" srcset=\"https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-delete-button.png 501w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-delete-button-300x146.png 300w\" sizes=\"(max-width: 501px) 100vw, 501px\" \/><\/p>\n<h3 id=\"stack-category-color\">Stacks now include the category color of each stack frame<\/h3>\n<p>This is a small but a nice addition. We have stacks in tooltips, the marker table and the sidebar. Previously, it wasn\u2019t possible to figure out which function belongs to which category. But with this change, you can now see their category colors on their left side. This gives you a quick overview of what\u2019s happening in this stack.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-198 size-large\" src=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/stack-categories-600x398.png\" alt=\"\" width=\"600\" height=\"398\" srcset=\"https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/stack-categories-600x398.png 600w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/stack-categories-300x199.png 300w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/stack-categories-768x509.png 768w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/stack-categories-1000x663.png 1000w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/stack-categories.png 1306w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/p>\n<h3 id=\"rust-profiler-api\">Profiler Rust API for thread registration has landed<\/h3>\n<p>Gecko Profiler didn\u2019t have a canonical Rust API. We had some hacks for multiple Rust projects, they were all similar but with subtle implementation differences. If you wanted to use profiler API functions in a new Rust project, you had to write everything again and again. We\u2019ve decided to make a canonical Rust crate for the profiler, so people who work on Rust code can easily import and start using it immediately. <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1690624\">We\u2019ve landed the first part<\/a> of this API now, which is about thread registration.<\/p>\n<p>If you are working on a Rust project with multiple threads, don\u2019t forget to register your threads with the Gecko Profiler. After registering them, you will be able to profile them by adding the thread names (or part thereof) to the custom thread names input in about:profiling.<a href=\"https:\/\/phabricator.services.mozilla.com\/D116517\"> It&#8217;s pretty straightforward<\/a> to register them with <code>gecko_profiler::register_thread<\/code> and <code>gecko_profiler::unregister_thread<\/code>.<\/p>\n<p>More Rust API functions for the profiler are coming soon!<\/p>\n<h3 id=\"internationalization\">Firefox Profiler Analysis UI is now internationalized<\/h3>\n<p>Our Outreachy intern Hasna Hena Mow (<a href=\"https:\/\/github.com\/CipherGirl\">CipherGirl<\/a>) has worked on the internationalization of the profiler.firefox.com. And thanks to her, this project is complete now! The actual translation process is happening now.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-199\" src=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/localized-firefox-profiler.png\" alt=\"A quick look on our localization work. The picture shows that now most of the strings are localized in the profiler analysis UI.\" width=\"1814\" height=\"1004\" srcset=\"https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/localized-firefox-profiler.png 1814w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/localized-firefox-profiler-300x165.png 300w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/localized-firefox-profiler-600x332.png 600w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/localized-firefox-profiler-768x425.png 768w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/localized-firefox-profiler-1536x850.png 1536w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/localized-firefox-profiler-1000x553.png 1000w\" sizes=\"(max-width: 1814px) 100vw, 1814px\" \/><\/p>\n<h3 id=\"screenshots-while-selecting\">Screenshots are now visible while selecting a time range<\/h3>\n<p>That\u2019s also one of the nice usability improvements. Previously, it wasn\u2019t possible to see the screenshots while selecting a time range. That was a bit annoying, because screenshots are good indicators of what\u2019s happening at that time, and they are usually good indicators when selecting a time range as well. So, <a href=\"https:\/\/github.com\/firefox-devtools\/profiler\/pull\/3316\">now<\/a> you can see them while selecting a range!<\/p>\n<div style=\"display: flex; justify-content: center;\">\n<div style=\"width: 491px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-194-1\" width=\"491\" height=\"345\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/webm\" src=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/screenshots-while-selecting-range.webm?_=1\" \/><a href=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/screenshots-while-selecting-range.webm\">http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/screenshots-while-selecting-range.webm<\/a><\/video><\/div>\n<\/div>\n<h3 id=\"android-trace-format-support\">Android Trace format support<\/h3>\n<p>You can now import Android trace format to Firefox Profiler analysis UI easily. Just drag and drop the .trace file into firefox.profiler.com, it will import and open the profile data automatically without any additional steps. You can also open it using the button \u201cLoad a profile from file\u201d.<\/p>\n<h3 id=\"profiler-category\">\u201cProfiler\u201d category showing the profiler overhead<\/h3>\n<p>We\u2019ve added a new category to show the profiler overhead. This is a pretty interesting indicator that we didn\u2019t have before, because this is actually showing us how much the profiler itself is affecting the profile that we are capturing. So after capturing a profile, if you see a lot of red categories in the timeline, it usually means that the profiler is working too much and possibly skewing the data you are capturing. In this case, you can try to reduce the overhead of the profiler by going to the about:profiling page and increasing the interval or disabling some of the features.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-201 size-medium\" src=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profiler-category-300x330.png\" alt=\"&quot;Profiler&quot; category will be displayed as red colors in the graph. Also it's possible to see the category in the sidebar category breakdown.\" width=\"300\" height=\"330\" srcset=\"https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profiler-category-300x330.png 300w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profiler-category-600x659.png 600w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profiler-category.png 628w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<h3 id=\"show-all-tracks\">\u201cShow all tracks\u201d button in the timeline tracks context menu<\/h3>\n<p>Another small feature to quickly make all the tracks visible! Quite handy when you have a lot of tracks and don\u2019t know what you are looking for.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-202\" src=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/show-all-tracks.png\" alt=\"&quot;Show All Tracks&quot; button can be found inside the context menu that appears when you click on &quot;X\/Y tracks visible&quot; button.\" width=\"1610\" height=\"276\" srcset=\"https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/show-all-tracks.png 1610w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/show-all-tracks-300x51.png 300w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/show-all-tracks-600x103.png 600w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/show-all-tracks-768x132.png 768w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/show-all-tracks-1536x263.png 1536w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/show-all-tracks-1000x171.png 1000w\" sizes=\"(max-width: 1610px) 100vw, 1610px\" \/><\/p>\n<h2 id=\"improvements\">Improvements<\/h2>\n<h3 id=\"better-network-markers\">Better network markers<\/h3>\n<p>Our network markers weren\u2019t always reliable, especially when it comes to service workers. They were mostly marked as \u201cunfinished markers\u201d and not being displayed in the front-end due to lack of correct recording. We\u2019ve made a lot of improvements to make them record properly and in the correct places. Some more fixes are coming in this area.<\/p>\n<div id=\"attachment_203\" style=\"width: 617px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-203\" decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-203\" src=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/network-markers.png\" alt=\"New network markers that belong to a service worker inside the &quot;Network&quot; tab.\" width=\"607\" height=\"137\" srcset=\"https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/network-markers.png 607w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/network-markers-300x68.png 300w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/network-markers-600x135.png 600w\" sizes=\"(max-width: 607px) 100vw, 607px\" \/><p id=\"caption-attachment-203\" class=\"wp-caption-text\">New network markers that belong to a service worker inside the &#8220;Network&#8221; tab.<\/p><\/div>\n<h3 id=\"jit-stack-walking\">Better stack walking around JIT<\/h3>\n<p>This was another big task we wanted to fix for a while. Sometimes, when a stack included JIT (Just In Time-compiled JavaScript) frames, it would fail to find their native calling functions, causing a large number of samples to appear in separate locations from where they should have been. The Profiler can now use JIT information to correctly restart stack walking when needed. It\u2019s a platform-dependent task, and only 64-bit Windows is fixed for now. macOS fixes are in review and will land soon, with other platforms to follow in the coming months.<\/p>\n<h3 id=\"marker-context-menu\">Better marker context menu<\/h3>\n<p>We display context menus in various places. And inside the Marker Chart and Marker Table panels, we are displaying the marker context menu. Previously, it wasn\u2019t really easy to understand and find the item that you want to click, even for people who are used to the profiler. Now, it\u2019s a lot easier to understand and find the item you want to click with better wording, icons, and bold texts where necessary.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-204\" src=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/marker-context-menu.png\" alt=\"Right clicking on a marker will open a context menu that you can do various marker operations.\" width=\"251\" height=\"243\" \/><\/p>\n<h3 id=\"markers\">Marker improvements<\/h3>\n<h4 id=\"new-markers\">New markers:<\/h4>\n<ul>\n<li aria-level=\"1\">\u00a0SetNeedStyleFlush\n<ul>\n<li aria-level=\"2\">This marker is very useful when the user is curious when and where a potential style invalidation happened.<\/li>\n<\/ul>\n<\/li>\n<li aria-level=\"1\">Runnable\n<ul>\n<li aria-level=\"2\">This marker is showing when a runnable is executed. This is especially useful to identify tasks that repeatedly take very little CPU time. These were impossible to find with only periodic stack sampling.<\/li>\n<\/ul>\n<\/li>\n<li aria-level=\"1\">Sync IPC\n<ul>\n<li aria-level=\"2\">Sync IPC is a common cause of slowness or blocked threads. You can easily see them with these markers now.<\/li>\n<\/ul>\n<\/li>\n<li aria-level=\"1\">CSS animation\n<ul>\n<li aria-level=\"2\">It\u2019s useful when you want to see which animation is running at a point in time. It also includes the animation name.<\/li>\n<\/ul>\n<\/li>\n<li aria-level=\"1\">CSS transition\n<ul>\n<li aria-level=\"2\">It\u2019s useful when you want to see if a transition is running. It also includes the transitioned property name.<\/li>\n<\/ul>\n<\/li>\n<li aria-level=\"1\">Perform microtasks\n<ul>\n<li aria-level=\"2\">It\u2019s useful to know when microtasks are executed.<\/li>\n<\/ul>\n<\/li>\n<li aria-level=\"1\">Worker.postMessage\n<ul>\n<li aria-level=\"2\">It\u2019s useful to know for sure which worker is involved. It either includes the worker name or the script url.<\/li>\n<\/ul>\n<\/li>\n<li aria-level=\"1\">RefreshObserver\n<ul>\n<li aria-level=\"2\">It\u2019s useful when you need to figure out why a refresh driver keeps firing, and it is doing so because it still has observers.<\/li>\n<\/ul>\n<\/li>\n<li aria-level=\"1\">Image Load and Image Paint\n<ul>\n<li aria-level=\"2\">They are useful when you need to see when an image loads and paints.<\/li>\n<\/ul>\n<\/li>\n<li aria-level=\"1\">Test markers (in TestUtils.jsm and BrowserTestUtils.jsm)\n<ul>\n<li aria-level=\"2\">It\u2019s useful when you are profiling a test. You can see more information about the state of the test and have an idea of what\u2019s happening in the timeline.<\/li>\n<li aria-level=\"2\">They are also being displayed first in the Marker Chart, as they are very relevant when they exist.<\/li>\n<\/ul>\n<\/li>\n<li aria-level=\"1\">Process Priority\n<ul>\n<li aria-level=\"2\">These markers track process priority change when they are done in the parent process, and also when child processes receive the corresponding notification. It&#8217;s useful to see if some low responsiveness may be due to priorities.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4 id=\"marker-fixes-improvements\">Fixes &amp; Improvements:<\/h4>\n<ul>\n<li aria-level=\"2\">We added more Inner Window IDs to the markers. The tooltips in the analysis UI show which markers belong to which URLs with this information.<\/li>\n<li aria-level=\"2\">Now you can see the proportion of nursery-allocated strings that were deduplicated on the GC Minor markers thanks to :sfink.<br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-205 size-large\" src=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/gc-minor-marker-600x312.png\" alt=\"GC Minor marker tooltip includes the proportion of nursery-allocated strings that were deduplicated.\" width=\"600\" height=\"312\" srcset=\"https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/gc-minor-marker-600x312.png 600w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/gc-minor-marker-300x156.png 300w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/gc-minor-marker-768x399.png 768w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/gc-minor-marker-1000x519.png 1000w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/gc-minor-marker.png 1028w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/li>\n<li aria-level=\"2\">Fixed a bug where the dot markers appeared in the wrong places. This was <a href=\"https:\/\/github.com\/firefox-devtools\/profiler\/pull\/3266\">an annoying bug<\/a> that made the dot markers appear in the wrong place. And it was changing the location depending on the zoom level. Now, our small markers are more reliable.<br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-212\" src=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/marker-chart-hittest-fix.png\" alt=\"Now you can click on the correct marker even though it's very small.\" width=\"1220\" height=\"674\" srcset=\"https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/marker-chart-hittest-fix.png 1220w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/marker-chart-hittest-fix-300x165.png 300w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/marker-chart-hittest-fix-600x330.png 600w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/marker-chart-hittest-fix-768x424.png 768w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/marker-chart-hittest-fix-1000x552.png 1000w\" sizes=\"(max-width: 1220px) 100vw, 1220px\" \/><\/li>\n<li aria-level=\"2\">Marker tooltips now display the inner window ids if there are multiple pages with the same URL. This is helpful when you have multiple pages open with the same URL. It can be either a webpage URL or internal chrome URLs. In this example, there were multiple browser.xhtml documents due to multiple windows. You can now figure out if they are the same browser.xhtml documents or not.<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-210\" src=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/dom-event-marker-tooltip.png\" alt=\"You can see the id at the right side of the URL now.\" width=\"400\" height=\"145\" srcset=\"https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/dom-event-marker-tooltip.png 762w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/dom-event-marker-tooltip-300x109.png 300w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/dom-event-marker-tooltip-600x217.png 600w\" sizes=\"(max-width: 400px) 100vw, 400px\" \/><\/li>\n<\/ul>\n<h3 id=\"chromeutils-addprofilermarker\">Capturing a stack and adding category support for the JavaScript <code>ChromeUtils.addProfilerMarker<\/code> API<\/h3>\n<p>You may know the <a href=\"https:\/\/searchfox.org\/mozilla-central\/rev\/9975889f5c0d5c59bd22121a454beba774cbae71\/dom\/chrome-webidl\/ChromeUtils.webidl#211-228\">ChromeUtils.addProfilerMarker<\/a> API for capturing a profiler marker from JavaScript. <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1674476\">With this change<\/a>, this API now supports capturing a stack and adding a category to them. Capturing a stack is important when you need to know the cause of an event. This will show up on the marker tooltips in the analysis UI. Similarly, categories will show up on the marker\u2019s tooltip in the Marker Chart, and in the sidebar in the Marker Table.<\/p>\n<h3 id=\"network-track-tooltips\">Tooltips in the network track<\/h3>\n<p>We had the network track for the visualization of the network markers. Previously it was only showing you where a network request starts and ends, but to be able to see more, you had to switch to the \u201cNetwork\u201d tab. Now you can directly hover over any network request in this track and it will show you the information about it in a tooltip. More improvements are coming in this area!<\/p>\n<div style=\"display: flex; justify-content: center;\">\n<div style=\"width: 394px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-194-2\" width=\"394\" height=\"270\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/webm\" src=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/network-marker-tooltips.webm?_=2\" \/><a href=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/network-marker-tooltips.webm\">http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/network-marker-tooltips.webm<\/a><\/video><\/div>\n<\/div>\n<h3 id=\"profile-info-button\">Made the Profile Info button more explicit<\/h3>\n<p>We have a profile info button on the top right corner of the analysis page. When you click on this button, we open the Profile Info panel where we display the metadata that were gathered from Firefox. This metadata includes profile related information like recording time and settings, application information like Firefox version and build ID and platform information like OS, ABI and CPU. We got some feedback about this button not being very visible and explicit. Now, it is.<\/p>\n<p>Before:<br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-207\" src=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-info-button-before.png\" alt=\"Previosly it was displayed as &quot;Uploaded Profile&quot;.\" width=\"1600\" height=\"98\" srcset=\"https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-info-button-before.png 1600w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-info-button-before-300x18.png 300w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-info-button-before-600x37.png 600w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-info-button-before-768x47.png 768w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-info-button-before-1536x94.png 1536w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-info-button-before-1000x61.png 1000w\" sizes=\"(max-width: 1600px) 100vw, 1600px\" \/>After:<br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-208\" src=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-info-button-after.png\" alt=\"Now it's displayed as &quot;Profile Info&quot;.\" width=\"1600\" height=\"102\" srcset=\"https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-info-button-after.png 1600w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-info-button-after-300x19.png 300w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-info-button-after-600x38.png 600w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-info-button-after-768x49.png 768w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-info-button-after-1536x98.png 1536w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-info-button-after-1000x64.png 1000w\" sizes=\"(max-width: 1600px) 100vw, 1600px\" \/><\/p>\n<h3 id=\"android-device-info\">Android device information inside the Profile Info panel<\/h3>\n<p>This is a small usability improvement for Android folks. It\u2019s in the panel we discussed in the previous improvement. Previously, it was possible to see the Android version, ABI and CPU information in the Platform section. But it wasn\u2019t possible to see the device name which is pretty important most of the time. Now, you can see that in the Profile Info panel on the top right corner.<\/p>\n<div id=\"attachment_209\" style=\"width: 510px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-209\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-209\" src=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/android-device-info-600x490.png\" alt=\"After opening the Profile Info panel on the top right corner, you will find the &quot;Device&quot; field under the Platform section\" width=\"500\" height=\"408\" srcset=\"https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/android-device-info-600x490.png 600w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/android-device-info-300x245.png 300w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/android-device-info-768x627.png 768w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/android-device-info.png 862w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><p id=\"caption-attachment-209\" class=\"wp-caption-text\">You can see that information under the \u201cplatform\u201d section inside Profile Info panel.<\/p><\/div>\n<h3 id=\"zip-file-viewer\">Zip file viewer now automatically expands all the children<\/h3>\n<p>This is another usability improvement. When you open profile data from a zip file (like the ones from treeherder) it\u2019s not always easy to find the profile data you want. Especially because treeherder puts the profile files in a folder that\u2019s buried under some other folders. Now it will be just a click away, because zip file viewer now expands all the children.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-211\" src=\"http:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-zip-file-viewer.png\" alt=\"All the children will be expanded automatically when you open a zip file.\" width=\"1336\" height=\"690\" srcset=\"https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-zip-file-viewer.png 1336w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-zip-file-viewer-300x155.png 300w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-zip-file-viewer-600x310.png 600w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-zip-file-viewer-768x397.png 768w, https:\/\/blog.mozilla.org\/performance\/files\/2021\/07\/profile-zip-file-viewer-1000x516.png 1000w\" sizes=\"(max-width: 1336px) 100vw, 1336px\" \/><\/p>\n<h3 id=\"xpidl-label-frames\">New label frames for XPIDL method\/getter\/setter calls<\/h3>\n<p>When JavaScript code calls an XPIDL method\/getter\/setter, we weren\u2019t doing a good job showing this. <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1707692\">Now, with the new label frames<\/a> you can see them easily, and with a category change as well. It\u2019s similar to what we already had for WebIDL.<\/p>\n<h3 id=\"profiler-memory-track\">Profiler buffer memory is no longer counted in the profiler memory tracks<\/h3>\n<p>A recent Profiler buffer change was affecting the memory track and was making it hard to see small memory changes unrelated to the Profiler (which typically uses 1MB chunks). With <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1705318\">this change<\/a>, it\u2019s now possible to see these small changes.<\/p>\n<h3 id=\"network-chart-accessibility\">Improved accessibility in the Network Chart<\/h3>\n<p>The Network Chart panel is more usable with only a keyboard now!<\/p>\n<h3 id=\"removed-ifdefs\">Removed many MOZ_GECKO_PROFILER ifdefs<\/h3>\n<p>Less places to potentially break on Tier-3 platform builds! We are still incrementally working on reducing the MOZ_GECKO_PROFILER ifdefs to make our and our users\u2019 life easier.<\/p>\n<h2 id=\"whats-next\">What\u2019s next?<\/h2>\n<p>We\u2019ve talked about the things we did so far. There are also so many things we still would like to do. I want to mention some of them here as well, in case you are curious. It\u2019s not going to be a complete list, but at least it can give you some ideas about the direction we are heading as the Performance Tools team.<\/p>\n<p>There is some unfinished work we would like to finish. Like shipping the Firefox Profiler in DevTools panel (also known as the unified profiler project), finishing the JIT stack walking fixes, landing more Rust Profiler APIs. But we also want to work on some new things like: Reducing the overhead of the profiler, making it easier to find unregistered threads and better support for profiling with many threads, making the IPC markers better, collecting CPU usage of all threads and\/or processes, making a lot more usability improvements and polishes.<\/p>\n<p>If you also have something on your mind about the things we can improve, please let us know!<\/p>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>Thanks for reading this far! It\u2019s been a busy first half in 2021 and we intend to continue making the Firefox Profiler better with the things I discussed in the previous section. If you have any questions or feedback, please feel free to reach out to me on Matrix (@canova:mozilla.org). You can also reach out to our team on Firefox Profiler channel on Matrix (#profiler:mozilla.org).<\/p>\n<p>If you profiled something and are puzzled with the profile you captured, we also have the Joy of Profiling (#joy-of-profiling:mozilla.org) channel where people share their profiles and get help from the people who are more familiar with the Firefox Profiler. In addition to that, we have the Joy of Profiling Open Sessions where some Firefox Profiler and Performance engineers gather together on Zoom to answer questions or analyze the profiles you captured. It\u2019s usually happening every Monday, and you can follow the <a href=\"https:\/\/calendar.google.com\/calendar\/embed?src=c_cbjhkf8gu6anajlklhuo04hpko%40group.calendar.google.com\">\u201cPerformance Office Hours\u201d calendar<\/a> to learn more about it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As the Perf-Tools team, we are responsible for the Firefox Profiler. This tool is built directly into Firefox to understand the program runtime and analyze it to make it faster. &hellip; <a class=\"go\" href=\"https:\/\/blog.mozilla.org\/performance\/2021\/07\/08\/performance-tools-newsletter-h1-2021\/\">Read more<\/a><\/p>\n","protected":false},"author":1859,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[447618,457005,457015,117,311,779,457016],"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/performance\/wp-json\/wp\/v2\/posts\/194"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/performance\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/performance\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/performance\/wp-json\/wp\/v2\/users\/1859"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/performance\/wp-json\/wp\/v2\/comments?post=194"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/performance\/wp-json\/wp\/v2\/posts\/194\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/performance\/wp-json\/wp\/v2\/media?parent=194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/performance\/wp-json\/wp\/v2\/categories?post=194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/performance\/wp-json\/wp\/v2\/tags?post=194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}