Home » Database » DB_DataObject » Bug #1127
setFrom is slow
Details
| Submitted | 2004-04-04 13:04 UTC |
|---|---|
| From | contact at mann dot fr |
| Status | Bogus |
| Package | DB_DataObject |
| PHP Version | 4.3.4 |
| OS | Linux (Debian i586) |
| Roadmaps | (Not assigned) |
Comments
[2004-04-04 13:04 UTC] contact at mann dot fr
Description:
------------
I have a DB_DataObject with 40 fields.
One of the fields is 2.1 kb. The rest are less than 64 bytes.
I'm on MySQL.
The setFrom operation takes 0.3 secondes.
That seems too long.
[2004-04-04 13:44 UTC] contact at mann dot fr
For info, some XDebug profiling before your modif :
Function Summary Profile (sorted by total execution time)
Total Time Taken Avg. Time Taken Number of Calls Function Name
0.2986131078 0.2986131078 1 *rapport->fromvalue
0.1936949780 0.1936949780 1 {require_once}
0.0478929237 0.0478929237 1 {require_once}
0.0243859726 0.0121929863 2 getenv
0.0116300983 0.0116300983 1 *rapport->fromvalue
0.0114809071 0.0114809071 1 *rapport->fromvalue
0.0035789023 0.0035789023 1 *rapport->fromvalue
0.0022819003 0.0022819003 1 *rapport->fromvalue
0.0019271062 0.0019271062 1 *date->date
0.0015540507 0.0015540507 1 *date_timezone::getdefault
0.0009914055 0.0000064377 154 sprintf
0.0006580382 0.0006580382 1 *date->date
0.0006281029 0.0006281029 1 *date->date
0.0005649886 0.0005649886 1 *rapport->fromvalue
0.0005619957 0.0005619957 1 *rapport->fromvalue
0.0005459536 0.0005459536 1 *date->format
0.0005379267 0.0005379267 1 *rapport->fromvalue
Since " $from " is an array, I don't see how coping/referencing would change things. Array's are funny about references, but I'll try.
I'm having fun with the table/fromValue stuff, unless you really think pass/by/ref changes something.
[2004-04-04 13:49 UTC] contact at mann dot fr
Function Summary Profile (sorted by total execution time)
Total Time Taken Avg. Time Taken Number of Calls Function Name
0.3049260229 0.3049260229 1 *rapport->fromvalue
0.2599940879 0.2599940879 1 {require_once}
0.0531181025 0.0531181025 1 *rapport->fromvalue
0.0528690729 0.0528690729 1 *rapport->table
0.0525910058 0.0525910058 1 *rapport->databasestructure
0.0183258877 0.0183258877 1 {require_once}
0.0023079126 0.0023079126 1 *rapport->fromvalue
0.0022900694 0.0022900694 1 *rapport->fromvalue
0.0018499658 0.0018499658 1 *rapport->fromvalue
0.0016209672 0.0016209672 1 *rapport->fromvalue
0.0016194787 0.0000145899 111 strtolower
0.0013909445 0.0013909445 1 *rapport->table
0.0010421646 0.0000067673 154 sprintf
0.0006978882 0.0006978882 1 *rapport->fromvalue
0.0006729774 0.0006729774 1 *date->date
0.0006688950 0.0006688950 1 *date->date
0.0006590280 0.0006590280 1 *date->date
[2004-04-04 14:08 UTC] contact at mann dot fr
DATE SEEMS TO BE THE CULPRIT
FROM VALUE affichage, 6, 2000-01-01
Time at ->table (col and stuff) in fromValue
'fromValue 0.000571966171265'
Time at return after fromValue is done
'affichage : 0.277346849442'
[2004-04-04 14:38 UTC] contact at mann dot fr
Yup APC takes care of that nicely.
'etat : 0.000288963317871'
'affichage : 0.000288963317871'
'relectures : 0.000288009643555'
Note that these times are without XDebug, but they demonstrate the usefulness of APC.