[FEAT] Implement benchmark for CPU and GPU for linear algebra, arithmetic and initializer methods
Create the benchmark using phpbench (https://github.com/phpbench/phpbench), a solid and well-maintained tool.
- [x] Add phpbench as requirement (require-dev)
- [x] Add benchmarks for the Initializers (https://numpower.org/api/category/initializers)
- [ ] Add benchmarks for the linear algebra methods (https://numpower.org/api/category/linear-algebra)
- [ ] Add benchmarks for the arithmetic methods (https://numpower.org/api/category/arithmetics)
- [ ] Add benchmarks for sum and products methods (https://numpower.org/api/category/sums-products-differences)
I would like to contribute and work on this feature
Nice @jiyo4476, thanks!
You can start with the initializers first so we can discuss a pattern and see what it looks like.
I was thinking of 3 matrices of sizes 10x100, 1000x500 and 10000x1000 and 3 vectors of size 100, 500, 1000 elements. This way we could also use it to identify algorithms that are potentially less performant with larger/smaller arrays.
When you want me to take a look, you can open the merge request. Ignore the merge request template guidelines as this issue does not apply.
Thank you! @henrique-borba
I created a new branch at https://github.com/jiyo4476/numpower and submitted a pull request. I added a composer.json file and installed dependencies with composer install.
Then I ran the benchmarks using ./vendor/bin/phpbench run benchmarks/initializers --report=aggregate
Currently, I only ran the tests with the compilation for CPU. I wanted to make sure I was adding the benchmarks correctly.
I was focused on update 0.6.0 but now I'm going to prioritize your MR.
Thanks again @jiyo4476
Made another pull request to be reviewed for the benchmarks for the other benchmarks. I would love to be able to help with other features as well.
Please review @henrique-borba
@jiyo4476 Hi, sorry for the delay, I had a big project at work and was also finishing another open source project for PHP. I'll do the review this week as soon as I get back to my home city. Thanks again.