tarekdj / db-benchmark Goto Github PK
View Code? Open in Web Editor NEWThis project forked from fprochazka/db-benchmark
http://forum.nette.org/cs/14592-lean-mapper-tenke-orm-nad-dibi?p=5#p106521
This project forked from fprochazka/db-benchmark
http://forum.nette.org/cs/14592-lean-mapper-tenke-orm-nad-dibi?p=5#p106521
'SELECT DISTINCT u.id FROM %s AS listuser
CROSS JOIN %s AS u
CROSS JOIN %s AS listmessage
LEFT JOIN %s AS um
ON (um.messageid = %d AND um.userid = listuser.userid)
WHERE true
AND listmessage.messageid = %d
AND listmessage.listid = listuser.listid
AND u.id = listuser.userid
AND um.userid IS NULL
AND u.confirmed and !u.blacklisted and !u.disabled'
I've ran it quite a few times on my local machine now, with generally similar results:
NDB 2.2 | Time: 1.950 s | Memory: 14.0 MB | PHP: 5.5.3-1ubuntu2.3 | Nette: 2.2.x
NotOrm | Time: 8.290 s | Memory: 7.3 MB | PHP: 5.5.3-1ubuntu2.3
PDO | Time: 0.089 s | Memory: 0.3 MB | PHP: 5.5.3-1ubuntu2.3
FluentPDO | Time: 0.721 s | Memory: 5.4 MB | PHP: 5.5.3-1ubuntu2.3
LeanMapper | Time: 1.668 s | Memory: 15.9 MB | PHP: 5.5.3-1ubuntu2.3
Doctrine2 | Time: 10.326 s | Memory: 27.4 MB | PHP: 5.5.3-1ubuntu2.3 | Doctrine: 2.4.2
'SELECT DISTINCT u.id FROM %s AS listuser
CROSS JOIN %s AS u
CROSS JOIN %s AS listmessage
LEFT JOIN %s AS um
ON (um.messageid = %d AND um.userid = listuser.userid)
WHERE true
AND listmessage.messageid = %d
AND listmessage.listid = listuser.listid
AND u.id = listuser.userid
AND um.userid IS NULL
AND u.confirmed and !u.blacklisted and !u.disabled'
We've been running the benchmarks without clearing query cache between all the tests, which probably makes the results incorrect.
I added a "reset query cache" in the PDO test and the difference is that before doing that the PDO result was:
PDO | Time: 0.067 s | Memory: 0.5 MB | PHP: 5.5.9-1ubuntu4.2
and after it was:
PDO | Time: 0.891 s | Memory: 0.5 MB | PHP: 5.5.9-1ubuntu4.2
That's a factor 13 difference, which is fairly significant.
This is the caching mechanism in Mysql, when loads of duplicate queries are performed.
'SELECT DISTINCT u.id FROM %s AS listuser
CROSS JOIN %s AS u
CROSS JOIN %s AS listmessage
LEFT JOIN %s AS um
ON (um.messageid = %d AND um.userid = listuser.userid)
WHERE true
AND listmessage.messageid = %d
AND listmessage.listid = listuser.listid
AND u.id = listuser.userid
AND um.userid IS NULL
AND u.confirmed and !u.blacklisted and !u.disabled'
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.