Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: Mutation observation metrics #271

Merged
merged 20 commits into from
Mar 11, 2019

Conversation

matatk
Copy link
Owner

@matatk matatk commented Feb 24, 2019

Collects information on mutations and sends this to the DevTools panel for display, when the DevTools panel is open.

TODO:

  • Styling for the DevTools panel (and how to avoid this being repeated in the other GUIs). Styling is now included.
  • What to do about the debugInfo preference? Is it needed any more? If not, should code be added to remove it? (Perhaps yes, and that code could then be removed for the next major version?) This will be tackled in the next PR.

TODO outside of this PR:

  • Add a feature to build a debug release (this is necessary for some of the profiling scripts to work, as console.timeStamp() must be called by the extension, and it doesn't seem easy, clean—or maybe possible—to turn on that setting with Puppeteer).
  • An optimisation would be to only send the mutation info to the DevTools panel when it's open and when the mutation stats UI is expanded (it's within a disclosure widget). This can be done later, though.

* When there is a mutation, send info on it to the DevTools panel.
* Also send curent pause time (but it is not updated).
This also fixes a bug that was introduced with the rename of the mutation-info message.
In order for the profiling script timestamps to work, a DEBUG build will need to be made.

The current debugInfo preference could be used for mutation info and/or info for web devs maybe?
* Also tidy up some commments.
* Calculate and send duration of last landmarks scan.
This makes the content script code neater.
This does actually keep the one for content script disconnection on Chrome.
* Content script should check if the DevTools panel is open when it boots up.
* The get-devtools-state and devtools-state messages replace devtools-panel-(open|clos)ed.
* Add a note to content script about whether the scheduled task bit is needed re PauseHandler.
* Clarify PauseHandler param names; send the pause state at start-up; add a TODO.
* Add a test page that injects landmarks automatically.
* If the guarded task is done, cancel a scheduled task (need to fully grok when this would occur).
* Add more logging back in (will be useful for debugging after #269.
* Update MSR class name.
* Revert the cancelling-the-timeout behaviour for PauseHandler as it borks lots of stuff :-) - do need to investigate further, though.
* Re-write the MutationStatsReporter using the same format as other Landmarks "classes" - it is more consistent, supports private variables and makes the pauseTime update simpler - of course it is not a real class, but there can only be one (per tab) so it is OK.
* Say when content script is booting.
* Say what the test page is doing.

This has shown there are some weirdnesses in the start-up behaviour of the mutation-guarding algorithm. It should be easier to diagnose them when #269 is done (though have been using the local page console, with timestamps enabled, as opposed to the Browser Console).
* Update build script to support conditional inclusion of devtools CSS.
* Style the mutation observation station.
* Use disclosure widgets to provide access to the mutation info and term definitions.

Next: i18n and only sending updates when the mutation observation station is open.
@matatk matatk force-pushed the look-at-mutation-observation-performance branch from 9bea68e to 1469567 Compare March 7, 2019 10:11
@matatk matatk merged commit 171b16a into master Mar 11, 2019
@matatk matatk deleted the look-at-mutation-observation-performance branch March 11, 2019 08:50
matatk added a commit that referenced this pull request Mar 19, 2019
As mentioned in #271, this adds support for making debug builds.

* Use yargs to improve options-handling in the build script.
* Simplify the npm scripts back to building/cleaning the extension for all browsers.
* Remove the "build:all:quick" script in favour of just calling the build script directly on the CLI.
* Remove the npm clean scripts; most of this is now done in the build script, which now has a clean mode.
* Support debug builds (in which console.timeStamp() calls are made).
* Update the README accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant