PHP Performance Metrics for low-level PHP methods.
profiles
folderprofile
- other than that, it's up to you as long as it's unique within the classE.g:
<?php
/* ...snip... */
public function profileStrlenWithShortString() {
strlen("This is a string");
}
By default the label used will be the actual code you're profiling, but if this gets too verbose or your profile is multiline, try:
<?php
/* ...snip... */
/**
* @label strlen() with a huge string
*/
public function profileStrlenWithHugeString() {
$str = "some very very very very very very ".
"very very very very very very very ".
"very very very very very very very ".
"long string here";
strlen($str);
}
profiles
folderIProfile
interfacegetTitle()
- this provides the profile group nameIf you've added new profiles or an entire group of profiles, you'll want to run a benchmark to make sure everything looks in order before submitting a pull request. The benchmarking tools are actually split into separate parts - a Test Runner and an HTML Reporter, but by chaining these together you'll get the desired results:
you@desktop:~/code/web/phpperf$ ./TestRunner.php | ./HtmlReporter.php > results.html
Simply open results.html
in a web browser and check your profiles are rendered as expected.
Please do not submit a pull request to the gh-pages branch with your own results.html page. The goal of the project is not to collect distributed performance benchmarks, but to provide a baseline for which some sense of relative and absolute performance can be guaged. Of course, you're welcome to publish and share your own results, but contributions to this project are far better served by either:
Apache 2.0