Performance: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(→‎Downloads API Rewrite: Update target and add link to feature page)
Line 117: Line 117:
|impact={{desktop}}
|impact={{desktop}}
|team=Paolo Amadini (lead), Raymond Lee, Felipe Gomes, Neil Deakin
|team=Paolo Amadini (lead), Raymond Lee, Felipe Gomes, Neil Deakin
|duration= Late July / early August for reaching the initial goal in Nightly.
|duration=Mid August for reaching the initial goal in Nightly.
Probably another month or two (with lower bandwidth) for follow-ups.
Probably another month or two (with lower bandwidth) for follow-ups.
|goal=To improve responsiveness when downloads are started, by removing the main-thread I/O caused by access to "downloads.sqlite". The concrete goal is to ensure that SQL statements involving moz_downloads no longer appear in the "slow SQL" Telemetry dashboard.
|goal=To improve responsiveness when downloads are started, by removing the main-thread I/O caused by access to "downloads.sqlite". The concrete goal is to ensure that SQL statements involving moz_downloads no longer appear in the "slow SQL" Telemetry dashboard.
|reports=firefox-dev mailing list, [http://benjamin.smedbergs.us/weekly-updates.fcgi/user/pamadini%40mozilla.com weekly updates tool].
|reports=firefox-dev mailing list, [http://benjamin.smedbergs.us/weekly-updates.fcgi/user/pamadini%40mozilla.com weekly updates tool].
|work={{bug|825588}}
|work={{bug|825588}}, [[Features/Desktop/Downloads_API|Feature Page]]
|dependencies=
|dependencies=
|notes=The project should include a follow-up time frame to accommodate any changes identified after Firefox for Desktop has migrated to the new API, as well as handle requests to facilitate other Mozilla products and add-ons to migrate to the new API.
|notes=The project should include a follow-up time frame to accommodate any changes identified after Firefox for Desktop has migrated to the new API, as well as handle requests to facilitate other Mozilla products and add-ons to migrate to the new API.

Revision as of 08:16, 20 August 2013

Performance

Mozilla's performance program focuses on improvements to the Gecko platform and the Firefox Desktop, Firefox for Android, and Firefox OS products.

Projects

Active

Incremental Cycle Collection (ICC)

Product impact [DESKTOP] [MOBILE] [B2G]
Goal Implement incremental cycle collection to reduce1 cycle collector pauses in the Firefox UI.

1Reduction in cycle collector pauses will be measured with the CYCLE_COLLECTOR_FULL Telemetry probe. The degree of reduction that can be achieved is currently unclear.

Duration TBD
Team Andrew McCreight (lead)
Progress reports TeamStatus: Andrew McCreight
Work bug 850065
Dependencies
Notes

Keep JS-accessible APIs from blocking the main thread

Product impact [DESKTOP] [MOBILE] [B2G]
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.
Duration TBD
Team David Rajchenbach-Teller (lead), Paolo Amadini
Progress reports TeamStatus: David Rajchenbach-Teller
Work Bugzilla query
Dependencies
Notes This project focuses on JS-accessible APIs in the context of Web Workers.

Profiler Backend for Mobile

Product impact [MOBILE] [B2G]
Goal Accurate1, crash-free, deadlock-free, low overhead2 stack unwinding for the SPS profiler for Firefox for Android and Firefox OS.

[1]The correct sequence of code return addresses on the stack, ideally without the unwind terminating before it gets back to main().
[2]Average unwind cost of 500 microseconds for a 30-frame backtrace on one core of a 1 GHz Cortex A9

Duration TBD
Team Julian Seward (lead), Benoit Girard, Mike Hommey
Progress reports Julian Seward's blog, TeamStatus: Julian Seward, Benoit Girard, Mike Hommey
Work bug 863453
Dependencies
Notes May impact desktop Linux as well.

Reducing time to first paint - Phase 1

Product impact [DESKTOP]
Goal A 10% reduction1 in time between XRE_Main and first paint2 during cold starts3 on Windows 7 with no extensions installed4, on reference slow hardware5, 30 seconds after an OS reboot.

[1]Currently, after an OS restart, XRE_Main to firstPaint takes about 4.2 seconds on the reference hardware. A 10% reduction will be ~400ms.
[2]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.
[3]Cold start because a lot of the work will be focused on reducing the amount of I/O done during startup.
[4]No extensions to exclude the impact of Irving's Add-on Manager work.
[5]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.

Duration TBD
Team Vladan Djeric (lead)
Progress reports Vladan Djeric's blog, TeamStatus: Vladan Djeric
Work bug 810156
Dependencies 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.

Replace Add-on Manager SQLITE with JSON file

Product impact [DESKTOP] [MOBILE]
Goal Goal: Reduce Add-on Manager impact on start-up time1 and runtime pauses2 by removing SQLITE database from XPI Provider and Add-on Repository and replacing with JSON3.

1Start-up time reduction by reducing the amount of I/O required before first paint.
2Runtime pause reduction by reducing I/O required during add-on up-to-date checks and updates, and making sure as much as possible is off main thread.
3New implementation will do no blocking I/O except minimal loading of required data during start-up.

Duration 6 weeks (approx week of May 27, 2013)
Team Irving Reid (lead), Felipe Gomes
Progress reports Irving Reid's blog, TeamStatus: Irving Reid, Felipe Gomes
Work bug 853388, bug 853389
Dependencies
Notes

Smooth Tab Animation

Product impact [DESKTOP]
Goal Reasonably1 smooth tabstrip animation on modern low-end AMD/Intel CPUs. The specific focus will be on use cases 1-8 defined below.
  1. New tab open of about:blank where other tabs are unaffected. (not common, this is our raw baseline)
  2. Tab close where other tabs are unaffected, and where the newly focused tab is empty. (also raw baseline)
  3. New tab open - with thumbnails preview - where other tabs are unaffected.
  4. 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.

1The last 70% of the animation is not lower than 50fps.

Duration TBD
Team Avi Halachmi (lead), Tim Taubert
Progress reports Avi Halachmi's blog, TeamStatus: Avi Halachmi
Work bug 815354
Dependencies OMTC
Notes

Network Cache Rewrite

Product impact [DESKTOP] [MOBILE] [B2G]
Goal A cache that causes no main thread I/O jank (directly or indirectly via locks)1, and that avoids losing the entire cache during crashes or unclean shutdown.2

[1]Currently the cache causes jank (sometimes in excess of 1 second) via main thread waiting while cache thread holds lock and does I/O.
[2]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.

Duration Goal is to have new code in production by end of Q4 2013
Team Honza Bambas (lead), Michal Novotny, Jason Duell (manager)
Progress reports
Work bug 877301
Dependencies
Notes Cache rewrite project wiki page

Downloads API Rewrite

Product impact [DESKTOP]
Goal To improve responsiveness when downloads are started, by removing the main-thread I/O caused by access to "downloads.sqlite". The concrete goal is to ensure that SQL statements involving moz_downloads no longer appear in the "slow SQL" Telemetry dashboard.
Duration Mid August for reaching the initial goal in Nightly.

Probably another month or two (with lower bandwidth) for follow-ups.

Team Paolo Amadini (lead), Raymond Lee, Felipe Gomes, Neil Deakin
Progress reports firefox-dev mailing list, weekly updates tool.
Work bug 825588, Feature Page
Dependencies
Notes The project should include a follow-up time frame to accommodate any changes identified after Firefox for Desktop has migrated to the new API, as well as handle requests to facilitate other Mozilla products and add-ons to migrate to the new API.

Remove localStorage From Browser Pages

Product impact [DESKTOP]
Goal Replace about: pages use of DOM Storage with more performant storage, like indexedDB, to remove UI hangs due to main-thread IO.
Duration
Team Marco Bonardo
Progress reports Marco's blog, weekly updates tool.
Work bug 729777 and dependencies
Dependencies
Notes

Complete Asynchronous History API

Product impact [DESKTOP]
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.
Duration
Team Marco Bonardo, Asaf Romano, Raymond Lee
Progress reports Marco's blog, 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.

Reduce Impact Of Bookmarks Backups On Shutdown

Product impact [DESKTOP]
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.

Duration
Team Raymond Lee, Marco Bonardo
Progress reports Marco's blog, 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:
  1. Convert APIs from synchronous to asynchronous - done
  2. Various improvements to ensure we store backups only when really needed, by skipping duplicates and giving better information to the users
  3. Async conversion, although some minor parts of the code should already be async converted as we go

Reduce Storage Connections Main-Thread Operations

Product impact [DESKTOP] [MOBILE]
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.
Duration
Team David Teller, Marco Bonardo
Progress reports Marco's blog, 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.


Asynchronous Places Annotations

Product impact [DESKTOP]
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.
Duration
Team Asaf Romano, Marco Bonardo
Progress reports Marco's blog, 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.


Improve Text Performance

Product impact [DESKTOP] [MOBILE] [B2G]
Goal ??
Duration
Team John Dagget, Jonathan Kew, Simon Montagu
Progress 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.


Reduce impact of thumbnailing

Product impact [DESKTOP]
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.
Duration 6 months
Team Drew Willicox, Mark Hammond
Progress reports Desktop weekly meeting notes, Drew's and 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.

On Hold

Shutdown

Product impact [DESKTOP]
Goal Ensure 95% of Firefox desktop instances shutdown in 3 seconds or less.
Duration TBD
Team Benoit Girard (lead)
Progress reports Benoit Girard's blog, TeamStatus: Benoit Girard
Work bug 819063
Dependencies
Notes
Hold reason Resource availability

Improve Places Hosts Storage

Product impact [DESKTOP]
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.
Duration
Team Marco Bonardo
Progress reports Marco's blog, 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.
Hold reason Resource availability, lower priority in comparison with other perf projects

Improve Space Efficiency Of Places URL Index

Product impact [DESKTOP]
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.
Duration
Team Marco Bonardo, Taras Glek
Progress reports Marco's blog, weekly updates tool.
Work bug 889561
Dependencies
Notes
Hold reason Resource availability, lower priority in comparison with other perf projects

Proposals

Project proposals should be listed on the perf etherpad.

Archive

Completed/terminated projects are listed in the project archive.

Tools

Communication

Communication Type Mechanism Audience
Announcements dev-platform list all
Meetings First Thursday of each month, 11am PT
  • Dial-in: Audio-only conference# 99355
    • People with Mozilla phones or softphones please dial x4000 Conf# 99355
    • US/Toll-free: +1 800 707 2533, (pin 4000) Conf# 99355
    • US/California/Mountain View: +1 650 903 0800, x4000 Conf# 99355
    • US/California/San Francisco: +1 415 762 5700, x4000 Conf# 99355
    • US/Oregon/Portland: +1 971 544 8000, x4000 Conf# 99355
    • CA/British Columbia/Vancouver: +1 778 785 1540, x4000 Conf# 99355
    • CA/Ontario/Toronto: +1 416 848 3114, x4000 Conf# 99355
    • UK/London: +44 (0)207 855 3000, x4000 Conf# 99355
    • FR/Paris: +33 1 84 88 37 37, x4000 Conf# 99355
    • Gmail Chat (requires Flash and the Google Talk plugin): paste +1 650 903 0800 into the Gmail Chat box that doesn't look like it accepts phone numbers
    • SkypeOut is free if you use the 800 number
  • Vidyo: Performance
  • IRC: #perf
  • Agenda: https://etherpad.mozilla.org/perf
all
Meeting summaries this wiki all
Micro status TeamStatus devs
Weekly status Mozilla Status Board devs

Press & Blog Posts

Progress Reports

2013

People

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

Project Champion
Program Management Lawrence Mandel
Product
Engineering Taras Glek, Vladan Djeric

References

Related Projects

Archive

Old Projects

Tools

Documentation and Presentations