Performance: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Overhauled Performance team wiki)
Line 1: Line 1:
=Performance=
=Performance=
Mozilla's performance program focuses on improvements to the Gecko platform and the Firefox Desktop, Firefox for Android, and Firefox OS products.
Mozilla's desktop performance team focuses on improvements to the Gecko platform and desktop Firefox.
You can find us on the #perf channel of irc.mozilla.org or you can email perf@mozilla.com
Weekly status report: [http://benjamin.smedbergs.us/weekly-updates.fcgi/ Mozilla Status Board]


==Projects==
'''The team:'''
===<span style="color: green">Active</span>===
* Vladan Djeric, :vladan on IRC, [http://blog.mozilla.org/vdjeric/ blog]
====<span style="color: green">Incremental Cycle Collection (ICC)</span>====
* Aaron Klotz :aklotz, [http://dblohm7.ca/ blog]
{{PerfProject
* Roberto Vitillo :rvitillo, [http://ravitillo.wordpress.com/category/mozilla/ blog]
|impact={{desktop}} {{mobile}} {{b2g}}
* Avi Halachmi :avih, [http://avih.github.io/ blog]
|team=Andrew McCreight (lead)
* David Teller :Yoric, [http://dutherenverseauborddelatable.wordpress.com/ blog]
|duration=TBD
* David Major :dmajor
|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>====
==Current Projects==
{{PerfProject
|impact={{desktop}} {{mobile}} {{b2g}}
|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>====
* [https://wiki.mozilla.org/Platform/2015-Q1-Goals#Perf Our Q1 2015 goals]
{{PerfProject
* [https://wiki.mozilla.org/Platform/2014-Q4-Goals#Perf Q4 2014 goals]
|impact={{mobile}} {{b2g}}
* [https://wiki.mozilla.org/Platform/2014-Q3-Goals#Perf Q3 2014 goals]
|team=Julian Seward (lead), Benoit Girard, Mike Hommey
* [https://wiki.mozilla.org/Platform/2014-Q2-Goals#Perf Q2 2014 goals]
|duration=TBD
* [https://wiki.mozilla.org/Platform/2014-Q1-Goals#Perf Q1 2014 goals]
|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>====
==Measuring & improving Firefox performance==
{{PerfProject
|impact={{desktop}}
|team=Avi Halachmi (lead), Tim Taubert
|duration=TBD
|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.
# New tab open of about:blank where other tabs are unaffected. (not common, this is our raw baseline)
# 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>====
===Write-ups===
{{PerfProject
* [[Performance/Evaluating_Performance_of_New_Features|How to evaluate the performance of Your New feature]]
|impact={{desktop}} {{mobile}} {{b2g}}
* [[Performance/Avoid_SQLite_In_Your_Next_Firefox_Feature|Avoid SQLite in your next Firefox feature]]
|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">Complete Asynchronous History API</span>====
===Tools===
{{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">Improve Text Performance</span>====
{{PerfProject
|impact={{desktop}} {{mobile}} {{b2g}}
|team=John Dagget, Jonathan Kew, Simon Montagu
|duration=
|goal= Text features are used by 100% of the user base. Any performance improvements we achieve have a direct effect on user satisfaction.
|reports=
|work={{Bug|863248}}, {{Bug|834609}}, {{Bug|885689}}
|dependencies=
|notes= https://etherpad.mozilla.org/textperfworkitems
}}
----
 
====<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 anonymously 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=
Previously we thought about moving all thumbnailing to the background service, but we're now planning on using the background service only when the foreground service declines to capture due to privacy-protection heuristics.
}}
----
 
===<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=
}}
----
====<span style="color: red">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.
}}
{{PerfProjectHold|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://developer.mozilla.org/en-US/docs/Mozilla/Performance/Adding_a_new_Telemetry_probe Adding a new Telemetry probe]
* [https://developer.mozilla.org/en-US/docs/Performance/Profiling_with_the_Built-in_Profiler SPS Profiler]
** The "More Dashboards" sidebar in the [http://telemetry.mozilla.org/ page above] has links to all our dashes
** [http://mozilla.github.io/cerberus/dashboard/ Cerberus]: Automated regression detection for Telemetry
*** Set the "alert_mails" field in your histogram declaration to get [https://groups.google.com/forum/#!forum/mozilla.dev.telemetry-alerts automatic email notifications] of regressions
** You can do custom Telemetry analyses using [http://mreid-moz.github.io/blog/2013/11/06/current-state-of-telemetry-analysis/ MapReduce] or [http://robertovitillo.com/2015/01/16/next-gen-data-analysis-framework-for-telemetry/ Spark]
* [https://developer.mozilla.org/en-US/docs/Performance/Profiling_with_the_Built-in_Profiler SPS Gecko Profiler]
** [https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Reporting_a_Performance_Problem Reporting a Performance problem]
* [[Buildbot/Talos]]
* [[Buildbot/Talos]]
** [http://graphs.mozilla.org graphs.mozilla.org]: for visualizing past Talos test results
** Joel Maher maintains a [http://alertmanager.allizom.org:8080/alerts.html?showAll=1 dashboard] of current Talos regressions & improvements


==Communication==
==Archive (Delete soon) ==
{| class="wikitable fullwidth-table"
! Communication Type !! Mechanism !! Audience
|-
| 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 ===
Old progress reports:
{| class="wikitable collapsible" style="width: 100%"
! style="background-color: rgb(221, 221, 221);" colspan="2" | 2014
|-
|
* June 2014 [[Performance/2014-12-06|Meeting Minutes]], [[Performance/Report-2014-06|Report]]
* June 2014 [[Performance/2014-12-06|Meeting Minutes]], [[Performance/Report-2014-06|Report]]
* February 2014 [[Performance/2014-02-13|Meeting Minutes]], [[Performance/Report-2014-02|Report]]
* February 2014 [[Performance/2014-02-13|Meeting Minutes]], [[Performance/Report-2014-02|Report]]
|}
{| class="wikitable collapsible" style="width: 100%"
! style="background-color: rgb(221, 221, 221);" colspan="2" | 2013
|-
|
* December 2013 [[Performance/2013-12-05|Meeting Minutes]], [[Performance/Report-2013-12|Report]]
* December 2013 [[Performance/2013-12-05|Meeting Minutes]], [[Performance/Report-2013-12|Report]]
* November 2013 [[Performance/2013-11-07|Meeting Minutes]], [[Performance/Report-2013-11|Report]]
* November 2013 [[Performance/2013-11-07|Meeting Minutes]], [[Performance/Report-2013-11|Report]]
Line 276: Line 53:
* [[Performance/2013-06-06|June 2013 Meeting Minutes]]
* [[Performance/2013-06-06|June 2013 Meeting Minutes]]
* [[Performance/2013-05-02|May 2013 Meeting Minutes]]
* [[Performance/2013-05-02|May 2013 Meeting Minutes]]
|}


==People==
Old Projects
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==
 
===Related Projects===
* [[Performance/MemShrink|MemShrink]]
 
==Archive==
===Old Projects===
* [[Firefox/Projects/Mobile_Startup_Shrink|Mobile Startup Shrink]]
* [[Firefox/Projects/Mobile_Startup_Shrink|Mobile Startup Shrink]]
* [[Firefox/Projects/Startup_Time_Improvements|Startup Performance]]
* [[Firefox/Projects/Startup_Time_Improvements|Startup Performance]]
Line 305: Line 62:
* [[Mobile/Performance|Mobile Performance Info]]
* [[Mobile/Performance|Mobile Performance Info]]


===Tools===
Tools:
* [[Codesighs]] - a tool which analyzes code and data size.
* [[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: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.
* [[Performance:Probes]]. Project to integrate a system of performance probes into Gecko.


===Documentation and Presentations===
Old Documentation and Presentations:
* Code Footprint [[Performance:Footprint_Reduction_Techniques]] explains common bad patterns and how to correct them.
* Code Footprint [[Performance:Footprint_Reduction_Techniques]] explains common bad patterns and how to correct them.
* [[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.
* [[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.

Revision as of 22:04, 30 January 2015

Performance

Mozilla's desktop performance team focuses on improvements to the Gecko platform and desktop Firefox. You can find us on the #perf channel of irc.mozilla.org or you can email perf@mozilla.com Weekly status report: Mozilla Status Board

The team:

  • Vladan Djeric, :vladan on IRC, blog
  • Aaron Klotz :aklotz, blog
  • Roberto Vitillo :rvitillo, blog
  • Avi Halachmi :avih, blog
  • David Teller :Yoric, blog
  • David Major :dmajor

Current Projects

Measuring & improving Firefox performance

Write-ups

Tools

Archive (Delete soon)

Old progress reports:

Old Projects

Tools:

Old Documentation and Presentations: