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

Benchmark prototype #901

Merged
merged 5 commits into from
Jan 19, 2018
Merged

Conversation

mzgoddard
Copy link
Contributor

Resolves

Related #554

Proposed Changes

  • Add benchmark suite
  • The individual benchmark at playground/index.html displays a link to the suite page after running
  • Control individual benchmark warm up and recording time as url components in the hash
  • Serialize individual benchmark data into its URL
  • A share link is displayed after the run with that encoded URL
  • Suite reports can be opened in the running frame for easy viewing
  • Save Reports as a JSON download and Compare Reports to load that JSON in a future run to compare changes made to the VM

Reason for Changes

The individual benchmark page was a stepping stone to this to provide a more representative view of performance across varying Scratch projects. The suite executes multiple projects in order with varying warm up and recording times.

Two high level performance statistics are immediately presented, steps per second and blocks per second. The steps per second are the number of times any thread is run until it yields or completes during one second. The blocks per second are the number of VM script blocks executed in a second. VM bound projects regularly show a similar number of blocks per second with steps per second being a representation of the complexity of the threads. Lower steps per second with a VM bound number of blocks per seconds relates to a higher number of blocks per step. Blocks per second lower than the VM bound value likely indicates a currently expensive block function being executed like pen_stamp. Lower blocks per second may also indicate a simple project or that the project is render bound.

More details can be viewed by click the steps per second and blocks per second values. Either opening in the benchmark frame or in a new tab.

All of the benchmark suite's reports can be saved together with the Save Reports link. This creates a JSON download to the local system that can be loaded with Compare Reports in a future run, during or after the run, to see side by side steps and blocks per second values. Or the second values can be clicked to see the other recorded performance values. This is great for recording a run and comparing later against the VM with an optimization implemented. There will be some margin for error between any two runs depending on other work the testing system may be doing.

Example benchmark run:
1-alt-suite

Example saving reports and re-running against the loaded report:
2-alt-suite

Example navigating detailed reports between two executions:
3-alt-suite

@boazsender
Copy link
Contributor

Pulled and tested, LGTM.

Also, love the bench and perma link links. Nice work!

@thisandagain
Copy link
Contributor

This looks great at first glance running locally @mzgoddard. 👍

@thisandagain
Copy link
Contributor

/cc @cwillisf @kchadha @paulkaplan

Copy link
Contributor

@rschamp rschamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an amazing amount of work that looks and runs great! Thank you @mzgoddard!

}
return _soon;
};
})();

This comment was marked as abuse.

@rschamp rschamp merged commit cc1923f into scratchfoundation:develop Jan 19, 2018
@thisandagain thisandagain added this to Done in Performance Oct 29, 2018
@TimothyKeaveny TimothyKeaveny removed this from Done in Performance Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants