firefox-devtools / profiler

Firefox Profiler — Web app for Firefox performance analysis
https://profiler.firefox.com
Mozilla Public License 2.0
1.21k stars 393 forks source link

[Locally Stored Profiles] Automatically store the profile locally after receiving it from the addon #11

Open mstange opened 8 years ago

mstange commented 8 years ago

When perf.html is opened from the Gecko Profiler addon, it should take the profile it received, store it in IndexedDB, generate an ID for it, and set the URL to /local/theGeneratedId/. And it should support loading the profile from IndexedDB when such a URL is navigated to.

The goal is to survive a browser restart without losing your state, even if you haven't shared the profile publicly.

Some of the problems we'll need to solve as part of this:

┆Issue is synchronized with this Jira Task

julienw commented 7 years ago

The goal is to survive a browser restart without losing your state, even if you haven't shared the profile publicly.

After sharing, should we delete the local data after changing the URL ?

Wait for symbolication to complete or no?

Actually, same question for public sharing :)

How to generate the ID?

Use a UUID ?

mstange commented 7 years ago

The goal is to survive a browser restart without losing your state, even if you haven't shared the profile publicly.

After sharing, should we delete the local data after changing the URL ?

I'd say yes.

Wait for symbolication to complete or no?

Actually, same question for public sharing :)

I'd say let's put it into the local database even during symbolication, and regularly update it until symbolication is done. We can rate-limit the update based on time, and maybe even additionally use requestIdleCallback.

How to generate the ID?

Use a UUID ?

Or a sha1 of a UUID? :)

Either way sounds good as long as we don't suddenly start putting dashes or curly braces into the URL. And the ID should be independent of symbolication because we want the following scenario to work:

  1. Collect the profile
  2. Apply some kind of filter
  3. Wait for symbolication to finish
  4. Click back to clear the filter
  5. Restart the browser If symbolication changed the URL, then the URL that you'd go back to would be invalid, and on restart we wouldn't be able to load the right profile for it.