Comparar edições
Profiling Thunderbird Performance
Edição 280390:
Edição 280390 de moz_contrib em
Edição 285777:
Edição 285777 de wsmwk em
Palavras-chave:
Thunderbird, Performance, Testing
Thunderbird, Performance, Testing
Resumo em resultado de pesquisas:
How to create a Thunderbird performance profile to find causes of high CPU load or slowness.
How to create a Thunderbird performance profile to find causes of high CPU load or slowness.
Conteúdo:
Creating a performance profile can be useful for developers to find the causes of high CPU load or slowness in Thunderbird. We will be using Firefox's performance profiler. You will only need to refer to the [https://profiler.firefox.com/docs/#/ Firefox profiler documentation] if you have trouble or want to do something special, such as profiling startup performance. In the documentation, anywhere 'Firefox' is mentioned, think 'Thunderbird'.
{note}'''Note:''' None of your private information is shared by default. Performance profiles which you capture and chose to share publicly do NOT contain personally identifiable nor private information unless you explicitly opt in to sharing such additional information.{/note}
__TOC__
= Step 1 - Preparing performance recording in Thunderbird =
The performance recorder is part of the ''Developer Toolbox'' in Thunderbird.
Before you start your recording, prepare as much as possible the scenario which you want to test in Thunderbird.
# In Thunderbird’s main window, open the ''Developer Toolbox'': Press {for win,linux}{key Ctrl+Shift+I}{/for}{for mac}{key Command+Shift+I}{/for}, '''''or''''' click on {menu ≡} > {menu Tools} > {menu Developer Tools}.
#;{warning}'''Important:''' Confirm the warning prompt ''Incoming Connection ... Allow connection?'' with {key OK} so that the toolbox can connect to your Thunderbird application.<br>Note: The prompt might be hidden behind other Thunderbird windows.{/warning}
# The ''Developer Tools'' window is shown.
# Current versions of Thunderbird will show the '''Performance''' tab with {button Start recording} shown. If you do not see that tab, then press {key F1}, or click on the {button •••} button in the top-right corner, then click on {menu Settings}. Ensure that {menu [✓] Performance} is checked. Then click on the {menu Performance} tab that has appeared at the top of the toolbox.
# '''Configure profiler settings:'''
## The ''about:profiling'' window is shown.
## Click "edit settings" which is the last item in the Developer Tools window.
## Select the "Thunderbird" preset, if it isn't already. (If you are using nightly/trunk builds, select the "Daily" preset.)
## Scroll down and also mark the checkbox for "All File IO".
## Change any other settings that might be needed. For example, if you expect to need a very long sample, longer than a minute, you might need to increase the buffer size from 1GB to 2GB, or reduce the sample interval to less than 1ms.
## Close the ''about:profiling'' window.
# Important: Before starting your performance recording, go back to the main Thunderbird window, and finish preparing the performance scenario to be recorded.
= Step 2 - Recording a performance profile =
You are now ready to record and save the performance profile of your scenario. Unless told otherwise, try to keep your recording as short as possible by recording only the exact set of actions which are suspected to cause the problem.
# In the {menu Performance} tab of the ''Developer Tools'' window, click on the {button Start Recording} button.
# Without delay, go back to the main Thunderbird window and perform the set of actions you want to record.
# Once finished, immediately select {button Capture Recording} in the ''Developer Tools'' window.
= Step 3 - Saving and sharing a performance profile =
# Click {button Capture recording} to finish the collection process and you will briefly see '''Capturing profile''', ending with a Firefox Profiler window. If you did not see the capture button then you are using an older version of Thunderbird ad profiler. Skip to the section on [[#w_old-versions-of-thunderbird|Old Versions of Thunderbird]].
# Click {button Upload local Profile}. For the profile which you are preparing to share, check the boxes for items which you wish to share your private information. {note}'''Note:''' The profile does NOT contain personally identifiable nor private information unless you explicitly opt in to sharing such additional information.{/note}
# Scroll down if necessary to do {button Download} for saving a local json file, or {button Upload} to send the profile to a repository at https://profiler.firefox.com/. '''Upload''' will provide a permalink in the form of https://share.firefox.dev/ which you can copy and share with developers and others who might help you with your problem.
# Close the Performance Profiler window.
# Close the Developers Tools window.
== Old versions of Thunderbird ==
Older versions of Thunderbird require some manual steps to save the profile.
# On the left side, right next to the new ''Recording #1'' item, click the '''Save''' link and save the file to somewhere on your computer. The file extension must be ''.json''.
# Go to https://profiler.firefox.com/ (yes, on firefox.com).
# Select {button Load a profile from file} and select the ''.json'' file which you just saved for upload.
# '''Important: Near the top-right, select the green {button Publish} button''', then in the ''Share Performance Profile'' panel, select the (blue) {button Publish} button again.
# Copy the link (e.g. https://share.firefox.dev/1XYZXYz) which pops up in the top-right corner under the new {button permalink} button and paste it into an appropriate [https://bugzilla.mozilla.org/enter_bug.cgi?product=Thunderbird new bug] or existing bug on [https://bugzilla.mozilla.org Bugzilla (BMO)].
# Finally, back in the ''Developer Tools'' {menu Performance} tab, you can delete the performance profile using the '''trash-icon''' just above the profile list in the left-top corner (where you saved the profile), and then close the ''Developer Tools'' window.
= Profiling Thunderbird startup and shutdown =
Profiling startup or shutdown involves [https://profiler.firefox.com/docs/#/./guide-startup-shutdown special, but very simple instructions]. Again, where 'Firefox' is mentioned, think 'Thunderbird'.
Creating a performance profile can be useful for developers to find the causes of high CPU load, slowness or memory usage in Thunderbird.
Some types of profiling will require using development build which you can obtain from [https://www.thunderbird.net/download/daily/ Thunderbird Daily download].
We will be using Firefox's performance profiler, so you may see references to Firefox in the profiler dialogs. [https://profiler.firefox.com/docs/#/ Firefox profiler documentation] is excellent, but you will only need to refer to it if you have trouble or want to do something special, such as profiling startup performance. In the documentation, anywhere 'Firefox' is mentioned, think 'Thunderbird'.
{note}'''Note:''' There is an opportunity to remove personally identifiable information before sharing data.{/note}
__TOC__
= Step 1 - Preparing performance recording in Thunderbird =
The performance recorder is part of the ''Developer Toolbox'' in Thunderbird.
Before you start your recording, prepare as much as possible the scenario to be tested in Thunderbird.
# In Thunderbird’s main window, open the ''Developer Toolbox'': Press {for win,linux}{key Ctrl+Shift+I}{/for}{for mac}{key Command+Shift+I}{/for}, '''''or''''' click on {menu ≡} > {menu Tools} > {menu Developer Tools}.
#;{warning}'''Important:''' Confirm the warning prompt ''Incoming Connection ... Allow connection?'' with {key OK} so that the toolbox can connect to your Thunderbird application.<br> <br>Note: The prompt might be hidden behind other Thunderbird windows.{/warning}
# The ''Developer Tools'' window is shown.
# Current versions of Thunderbird will show the '''Performance''' tab with {button Start recording} shown. If you do not see that tab, then press {key F1}, or click on the {button •••} button in the top-right corner, then click on {menu Settings}. Ensure that {menu [✓] Performance} is checked. Then click on the {menu Performance} tab that has appeared at the top of the toolbox.
# If you see "Failed to get the active browserId while starting the profiler" this may be ignored.
# '''Configure profiler settings:'''
## Click "edit settings" which is the last item in the Developer Tools window.
## The ''about:profiling'' window is shown.
## Select the "Thunderbird" preset, if it isn't already. After this point, when you mark any other settings, the preset will change to "Custom" which is normal. (If you are using nightly/trunk builds, select the "Daily" preset.)
## If you have any privacy concerns, or to save memory, unmark the checkbox for "Screenshots".
## Scroll down and also mark the checkbox for "All File IO".
## Change any other settings that might be needed, for example, "Native Allocations" (for high memory issues. (Native allocations requires using Thunderbird daily builds.)
## If you need more than a minute to capture the problem you are profiling, or added certain additional collections, then you may need to adjust some '''Buffer Settings"" such increase the "Buffer size" from 1GB to 2GB, and increase the "Sampling interval" from the default 1ms.
## Close the ''about:profiling'' using the window controls. (there is no OK or Save button)
# Important: Before starting your performance recording, go back to the main Thunderbird window, and finish preparing the performance scenario to be recorded.
= Step 2 - Recording a performance profile =
You are now ready to record and save the performance profile of your scenario. Unless told otherwise, try to keep your recording as short as possible by recording only the exact set of actions which are suspected to cause the problem.
# In the {menu Performance} tab of the ''Developer Tools'' window, click on the {button Start Recording} button.
# Without delay, go back to the main Thunderbird window and perform the set of actions you want to record.
# Once finished, immediately select {button Capture Recording} in the ''Developer Tools'' window.
= Step 3 - Saving and sharing a performance profile =
# Click {button Capture recording} to finish the collection process and you will briefly see '''Capturing profile''', ending with a Firefox Profiler window "https://profiler.firefox.com/from-browser/". If you did not see the capture button then you are using an older version of Thunderbird ad profiler. Skip to the section on [[#w_old-versions-of-thunderbird|Old Versions of Thunderbird]].
# Click {button Upload local Profile}. For the profile which you are preparing to share there is a list of items under "Include additional data that may be identifiable" - uncheck the boxes for any private information items which you wish to not share.
# Scroll down to the choices for saving the data. Use {button Download} for saving a local json file which you may then privately email to someone else or attach to a bug report. Use {button Upload} to send the profile to a repository at https://profiler.firefox.com/. '''Upload''' will provide a permalink in the form of https://share.firefox.dev/ which you can copy and share with developers and others who might help you with your problem.
# Close the Performance Profiler window.
# Close the Developers Tools window.
== Old versions of Thunderbird ==
Older versions of Thunderbird require some manual steps to save the profile.
# On the left side, right next to the new ''Recording #1'' item, click the '''Save''' link and save the file to somewhere on your computer. The file extension must be ''.json''.
# Go to https://profiler.firefox.com/ (yes, on firefox.com).
# Select {button Load a profile from file} and select the ''.json'' file which you just saved for upload.
# '''Important: Near the top-right, select the green {button Publish} button''', then in the ''Share Performance Profile'' panel, select the (blue) {button Publish} button again.
# Copy the link (e.g. https://share.firefox.dev/1XYZXYz) which pops up in the top-right corner under the new {button permalink} button and paste it into an appropriate [https://bugzilla.mozilla.org/enter_bug.cgi?product=Thunderbird new bug] or existing bug on [https://bugzilla.mozilla.org Bugzilla (BMO)].
# Finally, back in the ''Developer Tools'' {menu Performance} tab, you can delete the performance profile using the '''trash-icon''' just above the profile list in the left-top corner (where you saved the profile), and then close the ''Developer Tools'' window.
= Profiling Thunderbird startup and shutdown =
Profiling startup or shutdown involves [https://profiler.firefox.com/docs/#/./guide-startup-shutdown special, but very simple instructions]. Again, where 'Firefox' is mentioned, think 'Thunderbird'.