Skip to content

Conversation

@darzu
Copy link
Contributor

@darzu darzu commented Nov 20, 2019

Record & report (to the console for now) key performance metrics including:

  • how long it took to reach certain milestones (from browser nav start; like: DOM loaded, tutorial load done, simulator ready, ...)
  • the duration of certain long functions like: loadBlockly, createProjectAsync, refreshToolbox

The point of this isn't for us as developers to analyze performance (use Chrome devtools for that), it's to have something easy that users can send us from wherever they are (e.g. China schools) so we can see what they're experiencing (instead of just "it loads really slow").

Here's an example report (Macbook w/ 6x CPU throttle):

performance report:
		first JS running @ 941ms
		DOM loaded @ 3s203ms
		workspace init finished @ 3s738ms
		loading started #tutorial @ 4s905ms
		loading done #updateeditorfile @ 7s
		loading done #tutorial @ 9s
		simulator ready @ 13s

		reloadAppTargetVariant took ~ 190ms
		prepareBlockly took ~ 193ms
		loadBlockly took ~ 1s513ms (4s49ms - 5s563ms)
		stopSimulator took ~ 148ms
		webworker recvHandler took ~ 201ms
		stopSimulator took ~ 75ms
		webworker recvHandler took ~ 106ms
		refreshToolbox took ~ 164ms
		domUpdate loadBlockly took ~ 1s183ms (7s - 9s)
		maybeShowPackageErrors took ~ 67ms
		updateToolbox took ~ 63ms
		webworker recvHandler took ~ 130ms
		prepareBlockly took ~ 87ms
		refreshToolbox took ~ 117ms
		loadTutorial loadBlockly took ~ 1s956ms (7s - 9s)
		createProjectAsync took ~ 4s271ms (5s676ms - 9s)
		webworker recvHandler took ~ 104ms
		refreshToolbox took ~ 114ms
		domUpdate loadBlockly took ~ 872ms

The report is logged once the "simulator ready" event happens, which appears to consistently be the latest milestone.

Any function that takes longer than 1 second will also be logged immediately:

[perf alert] createProjectAsync took ~ 4s271ms

@darzu darzu requested a review from abchatra November 20, 2019 19:35
@darzu darzu changed the title Dazuniga/perf count Record & console log performance metrics Nov 20, 2019
@darzu darzu force-pushed the dazuniga/perf_count branch from 2464f90 to 9980ae1 Compare November 20, 2019 23:27
@darzu
Copy link
Contributor Author

darzu commented Nov 21, 2019

ping @abchatra

@abchatra
Copy link
Collaborator

Looks good.

@pelikhan
Copy link
Member

A format that would be importeable in Excel would be helpful to do further analysis.

@pelikhan
Copy link
Member

pelikhan commented Nov 21, 2019

Can we log the report to analytics as well?

A format that would be importeable in Excel would be helpful to do further analysis.

Yes, the plan is to report these via App Insights once we've determined this is useful. Later PR. It'll definitely be machine readable then.

EDIT: (This is Daryl:) something strange went on here. For some reason instead of adding an new comment my reply edited Peli's. Maybe I mis-clicked

@darzu darzu merged commit ed1e0b0 into master Nov 21, 2019
@darzu darzu deleted the dazuniga/perf_count branch November 21, 2019 16:58
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.

4 participants