sergeyklay / php-orm-benchmark Goto Github PK
View Code? Open in Web Editor NEWThe benchmark to compare performance of PHP ORM solutions.
License: MIT License
The benchmark to compare performance of PHP ORM solutions.
License: MIT License
The read scenario always gets entity by id 1, which leads to triggering identity map, and these fast results compared to phalcon:
root@82c267f32816:/app# php run doctrine read 1000
Start Doctrine benchmarking...
Method: read
Call times: 1000
Elapsed time: 0.23 ms.
Memory usage: 1.31 KiB.
Memory peak: 2,318.59 KiB.
Total elapsed time: 245.17 ms.
Total memory usage: 2,028,436.57 KiB.
Total memory peak: 4,096.00 KiB.
root@82c267f32816:/app# php run phalcon read 1000
Start Phalcon benchmarking...
Method: read
Call times: 1000
Elapsed time: 0.76 ms.
Memory usage: 0.07 KiB.
Memory peak: 856.21 KiB.
Total elapsed time: 772.19 ms.
Total memory usage: 754,452.58 KiB.
Total memory peak: 2,048.00 KiB.
I would assume other ORMs also have identity maps, not mamking the query another time, which makes the read benchmarks not comparable.
It can't be changed to $i+1
though, because only id 1 has the fixture data with the comments available.
IN addition compared to my numbers, your seems way too extreme. Why kind of base system do you have for docker? I honestly wouldnt trust any numbers coming out of a docker dev environment.
Refs: #26
The CakePHP and Doctrine ORMs both recommend that metadata caching be enabled to get better performance in production environments. I noticed that these benchmarks do not enable metadata caching. Would you be open to a pull request adding metadata caching for these ORMs?
Need automatically update reports from the Travis build via authorized push to GitHub repo with [ci skip]
.
Thanks for publishing this project! If it's possible, I'd love to see Doctrine ORM added to this benchmark. Thanks!
Hi,
Have you thought of splitting the providers to its own folder and having an independent composer.json file ?
Else I wonder whether the memory consumption of different components by composer autoload have some effect.
Normally the issue on big project is the scalping of the database not as much the frontal server where php executed.
What would be interesting (minimally) is the amount of queries made when the orm is properly configure. Mean if I have a relation on another table does it do a join or a extra queries ? If I am reloading a the same entity again by primary key does it load it from a pool of instances (context cache) or hitting the database again ? Etc.
Using blackfire would help.
There is a common use case: fetch N posts with their comments.
It will be nice to update MySQL dump and code to test this scenario in read
bench
Hi,
I am not using docker.
Just testing on the localhost with the changes made to configuration file.
Running
./run activerecord create
./run cake create
./run doctrine create
./run eloquent create
./run eloquent create
Every tests shows results. But only the ./run doctrine create
is inserting record to the database.
The assert()
doesn't do anything if there is no handler. So may be need to improve the tests?
Did you verified the data is being inserted ?
I agree the benchmark.ini settings are not considered.
New docker images already have this logic:
echo exit 101 > /usr/sbin/policy-rc.d
chmod +x /usr/sbin/policy-rc.d
echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup
echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache
Hey, was wondering if it could be possible to add Opulence ORM in the benchmark results?
https://github.com/opulencephp/orm
https://www.opulencephp.com/docs/1.1/orm-basics
Select 500 employees from the Employees database, for each of them show all of their salaries and all the departments they belong to.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.