Download the PHP package petrknap/php-profiler without Composer
On this page you can find all versions of the php package petrknap/php-profiler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download petrknap/php-profiler
More information about petrknap/php-profiler
Files in petrknap/php-profiler
Package php-profiler
Short Description PHP profiler
License MIT
Homepage https://petrknap.github.io/docs/php-profiler.html
Informations about the package php-profiler
PHP profiler
- What is profiling?
- Components
- Profile
- Usage
- SimpleProfiler
- AdvancedProfiler
- Profile
- How to install
What is profiling?
In software engineering, profiling ("program profiling", "software profiling") is a form of dynamic program analysis that measures, for example, the space (memory) or time complexity of a program, the usage of particular instructions, or the frequency and duration of function calls. Most commonly, profiling information serves to aid program optimization. -- Profiling (computer programming) - Wikipedia, The Free Encyclopedia
Components
Profile
Profile
is base data structure returned by profilers and wrapper for chosen one.
Usage
If you wish to profile a block of code, simply encapsulate it between Profile::start
and Profile::finish
calls.
If you wish, you can add labels to your profiles. The syntax is same as for sprintf
.
If you wish to create more detailed profiles, start new profile inside another one.
Or (if you wish) you can call start
and finish
methods directly on requested profiler.
SimpleProfiler
SimpleProfiler
is easy-to-use and quick static class for PHP code profiling. You can extend it and make your own specific profiler just for your use-case.
AdvancedProfiler
AdvancedProfiler
is advanced version of SimpleProfiler
with support for post processor.
How to install
Run composer require petrknap/php-profiler
or merge this JSON code with your project composer.json
file manually and run composer install
. Instead of dev-master
you can use one of released versions.
Or manually clone this repository via git clone https://github.com/petrknap/php-profiler.git
or download this repository as ZIP and extract files into your project.