Performance: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
 
(57 intermediate revisions by 17 users not shown)
Line 1: Line 1:
=Performance=
The Firefox performance team focuses on improvements to the Gecko platform and Firefox across desktop and mobile.
Mozilla's performance program focuses on improvements to the Gecko platform and the Firefox Desktop, Firefox for Android, and Firefox OS products.
If you have performance-related questions, ask us in [https://chat.mozilla.org/#/room/#perf-help:mozilla.org #perf-help:mozilla.org on Matrix] and #perf-help on Slack. For general discussion, find us at [https://chat.mozilla.org/#/room/#perf:mozilla.org #perf:mozilla.org on Matrix].


==Projects==
'''The team:'''
===<span style="color: green">Active</span>===
* Performance Engineering
====<span style="color: green">Incremental Cycle Collection (ICC)</span>====
* [[Performance/Tools|Performance Tools]]
{{PerfProject
|impact={{desktop}} {{mobile}} {{b2g}}
|team=Andrew McCreight (lead)
|duration=TBD
|goal=Implement incremental cycle collection to reduce<sup>1</sup> cycle collector pauses in the Firefox UI.
<sup>1</sup><span style="font-size: 80%;">Reduction in cycle collector pauses will be measured with the [http://mzl.la/XLsAoB CYCLE_COLLECTOR_FULL Telemetry probe]. The degree of reduction that can be achieved is currently unclear.</span>
|reports=TeamStatus: [http://teamstat.us/#show/irc.mozilla.org/perf/mccr8 Andrew McCreight]
|work={{bug|850065}}
|dependencies=
|notes=
}}
----


====<span style="color: green">Keep JS-accessible APIs from blocking the main thread</span>====
Here are some related pages you may be interested in:
{{PerfProject
* [[Performance/Triage]]
|impact={{desktop}} {{mobile}} {{b2g}}
* [[Performance/Fenix]]
|team=David Rajchenbach-Teller (lead), Paolo Amadini
|duration=TBD
|goal=Refactor existing and provide new JS APIs to either migrate services, components, and add-ons off the main thread or at least prevent them from blocking the main thread.
|reports=TeamStatus: [http://teamstat.us/#show/irc.mozilla.org/perf/Yoric David Rajchenbach-Teller]
|work=[http://mzl.la/ZJaowA Bugzilla query]
|dependencies=
|notes=This project focuses on JS-accessible APIs in the context of Web Workers.
}}
----


====<span style="color: green">Profiler Backend for Mobile</span>====
==Measuring & improving Firefox performance==
{{PerfProject
|impact={{mobile}} {{b2g}}
|team=Julian Seward (lead), Benoit Girard, Mike Hommey
|duration=TBD
|goal=Accurate<sup>1</sup>, crash-free, deadlock-free, low overhead<sup>2</sup> stack unwinding for the SPS profiler for Firefox for Android and Firefox OS.
<sup>[1]</sup><span style="font-size: 80%;">The correct sequence of code return addresses on the stack, ideally without the unwind terminating before it gets back to main().</span><br/>
<sup>[2]</sup><span style="font-size: 80%;">Average unwind cost of 500 microseconds for a 30-frame backtrace on one core of a 1 GHz Cortex A9</span>
|reports=[https://blog.mozilla.org/jseward Julian Seward's blog], TeamStatus: [http://teamstat.us/#show/irc.mozilla.org/perf/sewardj Julian Seward], [http://teamstat.us/#show/irc.mozilla.org/perf/BenWa Benoit Girard], [http://teamstat.us/#show/irc.mozilla.org/perf/glandium Mike Hommey]
|work={{bug|863453}}
|dependencies=
|notes=May impact desktop Linux as well.
}}
----
====<span style="color: green">Reducing time to first paint - Phase 1</span>====
{{PerfProject
|impact={{desktop}}
|team=Vladan Djeric (lead)
|duration=TBD
|goal=A 10% reduction<sup>1</sup> in time between XRE_Main and first paint<sup>2</sup> during cold starts<sup>3</sup> on Windows 7 with no extensions installed<sup>4</sup>, on reference slow hardware<sup>5</sup>, 30 seconds after an OS reboot.
<sup>[1]</sup><span style="font-size: 80%;">Currently, after an OS restart, XRE_Main to firstPaint takes about 4.2 seconds on the reference hardware. A 10% reduction will be ~400ms.</span><br/>
<sup>[2]</sup><span style="font-size: 80%;">XRE_Main as the starting point to exclude the impact of loading Firefox binaries as they grow bigger with every release. First paint to exclude the impact of Yoric's session store refactor work.</span><br/>
<sup>[3]</sup><span style="font-size: 80%;">Cold start because a lot of the work will be focused on reducing the amount of I/O done during startup.</span><br/>
<sup>[4]</sup><span style="font-size: 80%;">No extensions to exclude the impact of Irving's Add-on Manager work.</span><br/>
<sup>[5]</sup><span style="font-size: 80%;">The reference hardware is a recent, slow Win7 laptop with an AMD C-50 dual-core @ 1 GHz, magnetic HDD, and 2GB shared RAM. A slow Windows laptop is used because it is consistently slow and can be easily debugged.</span>
|reports=[https://blog.mozilla.org/vdjeric/category/start-faster/ Vladan Djeric's blog], TeamStatus: [http://teamstat.us/#show/irc.mozilla.org/perf/vladan Vladan Djeric]
|work= {{bug|810156}}
|dependencies= [[Performance#Replace_Add-on_Manager_SQLITE_with_JSON_file|Replace Add-on Manager SQLITE with JSON file project]]
|notes=Will measure with about:telemetry on reference hardware as aggregate Telemetry includes both warm and cold starts and a variety of hardware confirgurations.
}}
----


====<span style="color: green">Smooth Tab Animation</span>====
===Write-ups===
{{PerfProject
* [https://firefox-source-docs.mozilla.org/performance/ Firefox performance knowledge-base]
|impact={{desktop}}
* [[Performance/Evaluating_Performance_of_New_Features|How to evaluate the performance of your new feature]]
|team=Avi Halachmi (lead), Tim Taubert
* Information on Talos automatic performance tests:
|duration=TBD
** [[TestEngineering/Performance/Talos/RegressionBugsHandling|What to do when your check-in causes a Talos regression]]
|goal=Reasonably<sup>1</sup> smooth tabstrip animation on modern low-end AMD/Intel CPUs. The specific focus will be on use cases 1-8 defined below.
** [[TestEngineering/Performance/Sheriffing|Additional reading: How the Automation Team does performance sheriffing]]
# New tab open of about:blank where other tabs are unaffected. (not common, this is our raw baseline)
* [[Performance/Avoid_SQLite_In_Your_Next_Firefox_Feature|Avoid SQLite in your next Firefox feature]]
# Tab close where other tabs are unaffected, and where the newly focused tab is empty. (also raw baseline)
# New tab open - with thumbnails preview - where other tabs are unaffected.
# Tab close where other tabs are unaffected, where the newly focused tab is heavy (e.g. GMail).
* 5-8. Same as the above, when other tabs are affected (shrunk/expanded) - up to 10 changing tabs.
<sup>1</sup><span style="font-size: 80%;">The last 70% of the animation is not lower than 50fps.</span>
|reports=[http://avih.github.io/blog/categories/tabstrip/ Avi Halachmi's blog], TeamStatus: [http://teamstat.us/#show/irc.mozilla.org/perf/avih Avi Halachmi]
|work={{bug|815354}}
|dependencies=OMTC
|notes=
}}
----


====<span style="color: green">Network Cache Rewrite</span>====
===Tools===
{{PerfProject
|impact={{desktop}} {{mobile}} {{b2g}}
|team=Honza Bambas (lead), Michal Novotny, Jason Duell (manager)
|duration=Goal is to have new code in production by end of Q4 2013
|goal=A cache that causes no main thread I/O jank (directly or indirectly via locks)<sup>1</sup>, and that avoids losing the entire cache during crashes or unclean shutdown.<sup>2</sup><br>
<sup>[1]</sup><span style="font-size: 80%;">Currently the cache causes jank (sometimes in excess of 1 second) via main thread waiting while cache thread holds lock and does I/O.</span><br>
<sup>[2]</sup><span style="font-size: 80%;">Cache is currently thrown away unless clean shutdown.  Cache loss rates per startup are 9% on windows desktop, 11% OSX, 22% Linux desktop, 25% metro.  New design will keep all cache entries and detect corruption on a per-entry basis.</span><br/>
|reports=
|work={{bug|877301}}
|dependencies=
|notes= [https://wiki.mozilla.org/Necko/Cache/Plans Cache rewrite project wiki page]
}}
----
 
====<span style="color: green">Remove localStorage From Browser Pages</span>====
{{PerfProject
|impact={{desktop}}
|team=Marco Bonardo
|duration=
|goal=Replace about: pages use of DOM Storage with more performant storage, like indexedDB, to remove UI hangs due to main-thread IO.
|reports=[http://blog.bonardo.net/tag/performance Marco's blog], [http://benjamin.smedbergs.us/weekly-updates.fcgi/user/mak%40mozilla.com weekly updates tool].
|work={{Bug|729777}} and dependencies
|dependencies=
|notes=
}}
----
====<span style="color: green">Complete Asynchronous History API</span>====
{{PerfProject
|impact={{desktop}}
|team=Marco Bonardo, Asaf Romano, Raymond Lee
|duration=
|goal=Replace all remaining synchronous history APIs with asynchronous alternatives. This will reduce possibilities of contention between the synchronous and the asynchronous APIs, that can cause long hangs of the UI.
|reports=[http://blog.bonardo.net/tag/performance Marco's blog], [http://benjamin.smedbergs.us/weekly-updates.fcgi/user/mak%40mozilla.com weekly updates tool].
|work={{Bug|699850}} and dependencies
|dependencies=Ensure to properly communicating add-ons compatibility issues before APIs removal, through blog post, Mozilla.dev.extensions, AMO team.
|notes=We should replace synchronous API that reports history status (bug 834541), this may be tricky since it’s required to be synchronous by some UI features and could slip off to the future, luckily it’s currently served through a cache that reduces its negative impact.
}}
----
====<span style="color: green">Reduce Impact Of Bookmarks Backups On Shutdown</span>====
{{PerfProject
|impact={{desktop}}
|team=Raymond Lee, Marco Bonardo
|duration=
|goal=Replace synchronous main-thread bookmarks backups with asynchronous background backups.
 
Bookmarks backups currently only run on idle, but some instances never hit idle causing the backups to occur on shutdown, which negatively impacts the shutdown time of the browser.
|reports=[http://blog.bonardo.net/tag/performance Marco's blog], [http://benjamin.smedbergs.us/weekly-updates.fcgi/user/mak%40mozilla.com weekly updates tool].
|work={{Bug|843357}} and dependencies, https://etherpad.mozilla.org/places-backups-changes
|dependencies=Ensure to properly communicating add-ons compatibility issues before APIs removal, through blog post, Mozilla.dev.extensions, AMO team.
|notes=This project will be completed in 3 parts:
#Convert APIs from synchronous to asynchronous - done
#Various improvements to ensure we store backups only when really needed, by skipping duplicates and giving better information to the users
#Async conversion, although some minor parts of the code should already be async converted as we go
}}
----
====<span style="color: green">Reduce Storage Connections Main-Thread Operations</span>====
{{PerfProject
|impact={{desktop}} {{mobile}}
|team=David Teller, Marco Bonardo
|duration=
|goal=Setting up and closing a Storage database connection happens on main-thread, even if then the connection is only used through the asynchronous API. This may cause visible jank, especially when there’s other IO ongoing. Introduce a new purely asynchronous connection that never hits the main-thread and update consumers to use it. This will also ensure consumers of this connection can’t wrongly abuse of the synchronous APIs and create thread contention.
|reports=[http://blog.bonardo.net/tag/performance Marco's blog], [http://benjamin.smedbergs.us/weekly-updates.fcgi/user/mak%40mozilla.com weekly updates tool].
|work={{Bug|702559}}, {{Bug|874814}}, {{Bug|885732}} and dependencies
|dependencies=
|notes=Need to blog about this change and update the documentation.
The asynchronous connection landed, though it still closes the database handle on main-thread though, so fixing that is the next goal for July. Consumers conversion may take some time, Sqlite.jsm has already been converted, autocomplete is ongoing, but each consumer has very specific requirements. Goal is to complete the connection and convert most common consumers by the end of September.
}}
----
====<span style="color: green">Asynchronous Places Annotations</span>====
{{PerfProject
|impact={{desktop}}
|team=Asaf Romano, Marco Bonardo
|duration=
|goal=Annotations allow to set specific flags on bookmarks and pages in history, to identify them or attach additional information, but they are synchronous, so bookmarks conversion to an asynchronous API is blocked on them and they are currently causing unpredictable main-thread IO. Introduce a new asynchronous API that allows to annotate pages and bookmarks asynchronously, convert internal consumers to it.
|reports=[http://blog.bonardo.net/tag/performance Marco's blog], [http://benjamin.smedbergs.us/weekly-updates.fcgi/user/mak%40mozilla.com weekly updates tool].
|work={{Bug|699844}} and dependencies
|dependencies=Ensure to properly communicating add-ons compatibility issues before APIs removal, through blog post, Mozilla.dev.extensions, AMO team.
|notes=The old service will keep living in parallel for a while, for compatibility reasons.
 
A first draft of the new API has been created. Asaf is going to create a first mock of the service and verify consumers requirements with it. Marco will work on the database schema and performances. Consumers conversion may take the most time and will likely be an iterative process once the API and the service are complete, by the end of the third quarter.
}}
----
====<span style="color: green">Improve Text Performance</span>====
{{PerfProject
|impact={{desktop}} {{mobile}} {{b2g}}
|team=John Dagget, Jonathan Kew, Simon Montagu
|duration=
|goal=??
|reports=
|work={{Bug|863248}}, {{Bug|834609}}, {{Bug|885689}}
|dependencies=
|notes=Need to sync with Jet on this project definition.
 
A first draft of the new API has been created. Asaf is going to create a first mock of the service and verify consumers requirements with it. Marco will work on the database schema and performances. Consumers conversion may take the most time and will likely be an iterative process once the API and the service are complete, by the end of the third quarter.
}}
----
====<span style="color: green">Reduce impact of thumbnailing</span>====
{{PerfProject
|impact={{desktop}}
|team=Drew Willicox, Mark Hammond
|duration=6 months
|goal=Toolkit has two services that capture thumbnails of pages: a "foreground" service and a new "background" service.  The foreground service draws the content windows of pages that the user has opened to canvases on the main thread.  The background service exposes an API that uses a remote xul:brower to load pages on demand in the hidden window and then in the content process draws the resulting content windows to canvases.  Both services write thumbnails to disk on a background thread from the main process.  The goal here is to minimize the impact in the broadest sense of both services: the user's perception of jank, resource use, time taken to draw to canvas, capturing only when necessary, etc.
|reports=[https://wiki.mozilla.org/Firefox/Meeting Desktop weekly meeting notes], [http://benjamin.smedbergs.us/weekly-updates.fcgi/user/adw%40mozilla.com/posts Drew's] and [http://benjamin.smedbergs.us/weekly-updates.fcgi/user/mhammond%40mozilla.com/posts Mark's] weekly updates
|work={{Bug|899401}}
|dependencies=
|notes=
 
Ultimately we want to move all thumbnail capturing off the main thread, probably using the background service that landed in Fx 25.  This service currently uses the Private Browsing feature to sandbox page loads, but declines to capture when a private browsing window is open, but can still have side-effects related to this (eg, if a capture is in-progress when PB mode is entered, it might cause cookies for a site to exist when they otherwise would not).  We plan to avoid using PB mode once we have identified a technique to make these requests totally isolated.
}}
----
 
===<span style="color: red">On Hold</span>===
====<span style="color: red">Shutdown</span>====
{{PerfProject
|impact={{desktop}}
|team=Benoit Girard (lead)
|duration=TBD
|goal=Ensure 95% of Firefox desktop instances shutdown in 3 seconds or less.
|reports=[http://benoitgirard.wordpress.com Benoit Girard's blog], TeamStatus: [http://teamstat.us/#show/irc.mozilla.org/perf/BenWa Benoit Girard]
|work={{bug|819063}}
|dependencies=
|notes=
}}
{{PerfProjectHold|Resource availability}}
----
====<span style="color: red">Improve Places Hosts Storage</span>====
{{PerfProject
|impact={{desktop}}
|team=Marco Bonardo
|duration=
|goal=Change the way we store hosts in Places to reduce work needed for inserting and querying pages. Currently we split www. and non www. hosts but we always use them as a single thing in all of the UI pieces, so we have to double the querying work to gather both.
|reports=[http://blog.bonardo.net/tag/performance Marco's blog], [http://benjamin.smedbergs.us/weekly-updates.fcgi/user/mak%40mozilla.com weekly updates tool].
|work={{Bug|843357}} and dependencies
|dependencies=
|notes=It's a one bug project, most of the time is needed to verify if the change may cause any issues and designing the new queries. It may take about a week.
}}
{{PerfProjectHold|Resource availability, lower priority in comparison with other perf projects}}
----
====<span style="color: red">Improve Space Efficiency Of Places URL Index</span>====
{{PerfProject
|impact={{desktop}}
|team=Marco Bonardo, Taras Glek
|duration=
|goal=The current URL index in places.sqlite database takes up to 30% of the database size. The features it provides can be obtained through a smarter hashing method that should improve the space efficiency by an order of magnitude. A smaller database has positive effects on IO and fragmentation.
|reports=[http://blog.bonardo.net/tag/performance Marco's blog], [http://benjamin.smedbergs.us/weekly-updates.fcgi/user/mak%40mozilla.com weekly updates tool].
|work={{Bug|889561}}
|dependencies=
|notes=
}}
{{PerfProjectHold|Resource availability, lower priority in comparison with other perf projects}}
----
===Proposals===
Project proposals should be listed on the [https://etherpad.mozilla.org/perf perf etherpad].
 
===Archive===
Completed/terminated projects are listed in the [[Performance/ProjectArchive|project archive]].


==Tools==
* [[Telemetry|Telemetry]]:
*[[Telemetry|Telemetry]]
** [http://telemetry.mozilla.org/ Telemetry dashboard]
* [https://github.com/mozilla/jydoop jydoop: Efficient and Testable hadoop map-reduce in Python] ([http://benjamin.smedbergs.us/blog/2013-04-09/introducing-jydoop-fast-and-sane-map-reduce/ Introduction from Benjamin Smedberg])
** [https://firefox-source-docs.mozilla.org/toolkit/components/telemetry/telemetry/start/adding-a-new-probe.html Adding a new Telemetry probe]
* [https://developer.mozilla.org/en-US/docs/Performance/Profiling_with_the_Built-in_Profiler SPS Profiler]
* [https://profiler.firefox.com/ Firefox Profiler]
** [https://firefox-source-docs.mozilla.org/performance/reporting_a_performance_problem.html Reporting a Performance problem]
* [[Buildbot/Talos]]
* [[Buildbot/Talos]]
* [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/GTest#MozGTestBench MozGTestBench]
** Write low level microbenchmarks using [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/GTest#MozGTestBench GTest]
* [[Using_XPerf| xperf]]
** [[Tracing VirtualAlloc With Xperf]]
* [https://github.com/chutten/statuser Statuser]: Restartless Firefox extension for as-it-happens hang monitoring.


==Communication==
===Meetings===
{| class="wikitable fullwidth-table"
====Joy of Profiling====
! Communication Type !! Mechanism !! Audience
Do you have a profile that you don't understand? Are you having problem analyzing a profile? Do you want more eyes on this little profile of yours?
|-
| Announcements || [https://lists.mozilla.org/listinfo/dev-platform dev-platform] list || all
|-
| Meetings || First Thursday of each month, 11am PT
{{conf|99355}}
* Vidyo: Performance
* IRC: [irc://irc.mozilla.org/perf #perf]
* Agenda: [https://etherpad.mozilla.org/perf https://etherpad.mozilla.org/perf]
|| all
|-
| Meeting summaries || [[Performance | this wiki]] || all
|-
| Micro status || [http://teamstat.us/#browse/irc.mozilla.org/perf TeamStatus] || devs
|-
| Weekly status || [http://benjamin.smedbergs.us/weekly-updates.fcgi/ Mozilla Status Board] || devs
|}
 
===Press & Blog Posts===
 


===Progress Reports ===
You have 2 options!
{| class="wikitable collapsible" style="width: 100%"
! style="background-color: rgb(221, 221, 221);" colspan="2" | 2013
|-
|
* August 2013 [[Performance/2013-08-01|Meeting Minutes]], [[Performance/Report-2013-08|Report]]
* [[Performance/2013-07-11|July 2013 Meeting Minutes]]
* [[Performance/2013-06-06|June 2013 Meeting Minutes]]
* [[Performance/2013-05-02|May 2013 Meeting Minutes]]
|}


==People==
Option 1: join us on [https://matrix.to/#/#joy-of-profiling:mozilla.org the Joy of Profiling channel on Element].
list required competencies for people and, once defined, the people working on project. note that not all of these competencies will be required for every project
{| class="wikitable fullwidth-table"
| Project Champion ||
|-
| Program Management || Lawrence Mandel
|-
| Product ||
|-
| Engineering || Taras Glek, Vladan Djeric
|-
|}


==References==
Option 2: join us in the Joy of Profiling meeting!
 
===Related Projects===
* [[Performance/MemShrink|MemShrink]]
 
==Archive==
===Old Projects===
* [[Firefox/Projects/Mobile_Startup_Shrink|Mobile Startup Shrink]]
* [[Firefox/Projects/Startup_Time_Improvements|Startup Performance]]
* [[Firefox:FrontEndPerformance|Front-end Performance]] (i.e., responsiveness)
* [[Performance/Addons|Add-on Performance]]
* [[Performance/Snappy|Snappy]]
* [[Mobile/Performance|Mobile Performance Info]]
 
===Tools===
* [[Codesighs]] - a tool which analyzes code and data size.
* [[Performance:Tools]]. For measuring performance. Tip o' the propeller-cap to [mailto:zuperdee@penguinpowered.com Daniel Roberts] (zuperdee@penguinpowered.com) for the pointers.
* [[Performance:Probes]]. Project to integrate a system of performance probes into Gecko.


===Documentation and Presentations===
* When:
* Code Footprint [[Performance:Footprint_Reduction_Techniques]] explains common bad patterns and how to correct them.
** Every first and third monday at 17:00 CET, 11am EST, 8am PST.
* [[Performance:Profiling_JuJu]]. Things you should know about doing profiling. Tips and tricks for some of the tools, and lots of other Good Things To Know.
** <del>Every second and fourth monday at 20:00 CET, 2pm EST, 11am PST.</del> Canceled for now, please contact us on the channel if you want to chat!
* [http://www.mozilla.org/performance/mac-performance.html Profiling and leak analysis] on the Mac.
* Where: [https://mozilla.zoom.us/j/98769155293 Zoom ID 987 6915 5293]
* [[Performance:Footprint_Tools]]. Presentation on footprint tools
* [[Performance:Startup]] [http://www.mozilla.org/performance/perf-intro/slide1.xml slides] Presentation on general performance tools
* [[Performance:Leak_Tools]]. Presentation on memory leaks detection tools
* [http://www.mozilla.org/performance/mac-performance.html Mac Performance Tools] Presentation on performance tools that work on Mac

Latest revision as of 15:41, 2 December 2024

The Firefox performance team focuses on improvements to the Gecko platform and Firefox across desktop and mobile. If you have performance-related questions, ask us in #perf-help:mozilla.org on Matrix and #perf-help on Slack. For general discussion, find us at #perf:mozilla.org on Matrix.

The team:

Here are some related pages you may be interested in:

Measuring & improving Firefox performance

Write-ups

Tools

Meetings

Joy of Profiling

Do you have a profile that you don't understand? Are you having problem analyzing a profile? Do you want more eyes on this little profile of yours?

You have 2 options!

Option 1: join us on the Joy of Profiling channel on Element.

Option 2: join us in the Joy of Profiling meeting!

  • When:
    • Every first and third monday at 17:00 CET, 11am EST, 8am PST.
    • Every second and fourth monday at 20:00 CET, 2pm EST, 11am PST. Canceled for now, please contact us on the channel if you want to chat!
  • Where: Zoom ID 987 6915 5293