[geeklog-devel] [Fwd: Re: [propel] Performance Benchmarks]
Tony Bibbs
tony at tonybibbs.com
Mon Dec 27 18:27:16 EST 2004
Here you go.
Results aren't the greatest. I've offered to do a detailed execution
profile for the Creole developers so they might have an idea where to
start looking should they decide to trim sometime off.
I think ideally we'd at least get PEAR::DB-ish performance.
--Tony
-------- Original Message --------
Subject: Re: [propel] Performance Benchmarks
Date: Sun, 26 Dec 2004 21:32:20 +0100
From: Dénes Szabó <d.taylor42 at gmail.com>
Reply-To: users at propel.tigris.org
To: users at propel.tigris.org
References: <41BEFBAA.3080602 at tonybibbs.com>
<41C10D74.2020502 at velum.net> <41C112F0.4050706 at tonybibbs.com>
<1c4a145c04121601161bcee6e0 at mail.gmail.com>
<41C7323C.1000802 at tonybibbs.com>
Hi!
I forgot it. Sorry!
I used the adodb's benchmark suite. (http://adodb.sourceforge.net/ ->
http://phplens.com/lens/adodb/)
I wrote a test case for creole:
benchcreole.php
<?php
include("_creole.inc.php");
include("_benchmark.inc.php");
?>
_creole.inc.php:
<?php
// average 2.65,2.65, 2.64, 2.66 for 100 times
ini_set('include_path', '.:pear');
include "creole/Creole.php";
$DBNAME = 'CREOLE DB';
function &Connect()
{
$dsn = "mysql://donci:asd123@localhost/test";
$db = Creole::GetConnection($dsn);
return $db;
}
// fetchInto -- note that it is less intuitive as DB_OK must be
explicitly checked
function QueryOnce(&$db,$debug)
{
$rs = $db->executeQuery('select
productid,productname,unitsinstock,unitprice from products');
while ($rs->next()) {
$id=$rs->getInt('productid');
$name=$rs->getString('productname');
$unitsinstock=$rs->getInt('unitsinstock');
$unitprice=$rs->getFloat('unitprice');
if ($debug) {
print "$id, $name, $unitsinstock, $unitprice<br>";
}
}
$rs->close();
}
// fetchRow is slower but superior API
function QueryOnce2(&$db,$debug)
{
$rs = $db->query('select productid,productname,unitsinstock,unitprice
from products');
while ($fields = $rs->fetchRow()) {
$id=$fields[0];
$name=$fields[1];
$unitsinstock=$fields[2];
$unitprice=$fields[3];
if ($debug) {
print "$id, $name, $unitsinstock, $unitprice<br>";
}
}
$rs->free();
}
?>
My dir structure is:
|-- adodb/
|-- pear
| |-- DB
| |-- creole
| `-- jargon
|-- _adodb.inc.php
|-- _benchmark.inc.php
|-- _creole.inc.php
|-- _dbx.inc.php
|-- _mdb.inc.php
|-- _metabase.inc.php
|-- _mysql.inc.php
|-- _pear.inc.php
|-- _phplib.inc.php
|-- benchadodb.php
|-- benchcreole.php
|-- benchdbx.php
|-- benchmdb.php
|-- benchmetabase.php
|-- benchmysql.php
|-- benchpear.php
|-- benchphplib.php
|-- createproducts.sql
`-- readme.txt
I used mysql for test (createproducts.sql)
My results are (with 2000 iteration!):
CREOLE DB: Queried 2000 times for 12.62241601944 seconds
PEAR DB: Queried 2000 times for 8.1311810016632 seconds
ADODB: Queried 2000 times for 4.7065849304199 seconds
MySQL: Queried 2000 times for 2.3287560939789 seconds
The smallest is the best. It is sad but the creole is the slowest. But
creole makes some plus goodies (getInt( ), getString( )). The adodb is
a very good db layer. (I used to it a lot).
On Mon, 20 Dec 2004 14:12:44 -0600, Tony Bibbs <tony at tonybibbs.com> wrote:
> Dénes, I never got this. Can you please post your results?
>
> --Tony
--
[dt]
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at propel.tigris.org
For additional commands, e-mail: users-help at propel.tigris.org
More information about the geeklog-devel
mailing list