#1510: Time is wasted in Hydration
------------------------------+---------------------------------------------
Reporter: colnector | Owner: romanb
Type: defect | Status: new
Priority: critical | Milestone:
Component: Query/Hydration | Version: 1.0.2
Resolution: | Keywords:
Has_test: 0 | Mystatus: Pending Core Response
Has_patch: 0 |
------------------------------+---------------------------------------------
Comment (by jwage):
Benchmarking code:
{{{
<?php
require_once('config.php');
Doctrine::loadModels('models');
/*
for ($i = 0; $i < 20000; $i++)
{
$user = new User();
$user->username = 'jwage';
$user->password = 'changeme';
$user->is_active = true;
$user->email_address = '[EMAIL PROTECTED]';
$user->save();
$user->free();
}
*/
$q = Doctrine_Query::create()
->from('User u')
->limit(20000);
$s = microtime(true);
$users = $q->fetchArray();
$e = microtime(true);
echo 'Took: ' . ($e - $s) . ' seconds' . PHP_EOL;
echo "Peak Memory Usage: " . memory_get_peak_usage() / 1024 . "KB" .
PHP_EOL;
}}}
Results for array hydration
Without Patch
{{{
Took: 67.757349967957 seconds
Peak Memory Usage: 18290.75KB
}}}
With Patch
{{{
Took: 1.2913060188293 seconds
Peak Memory Esage: 17318.07421875KB
}}}
Results for record hydration
Without Patch
{{{
Took: 53.284394025803 seconds
Peak Memory Usage: 44204.89453125KB
}}}
With Patch
{{{
Took: 51.691879987717 seconds
Peak Memory Usage: 44206.0625KB
}}}
--
Ticket URL: <http://trac.doctrine-project.org/ticket/1510#comment:3>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"doctrine-svn" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---