Home » Database » DB » Bug #2404
optimization
Details
| Request #2404 | optimization |
|---|---|
| Submitted | 2004-09-27 07:31 UTC |
| From | struchkov at ma-journal dot ru |
| Assigned | danielc |
| Status | Wont fix |
| Package | DB |
| PHP Version | 4.2.2 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2004-09-27 07:31 UTC] struchkov at ma-journal dot ru
Description:
------------
I optimize DB_common::prepare.
1) Add array cash_prepare_tokens to DB_common member.
2) In the begining of this function I add this code:
if (isset($this->cash_prepare_tokens[crc32($query)])) return $this->cash_prepare_tokens[crc32($query)];
3) At the end before return I add
$this->cash_prepare_tokens[crc32($query)]=$k;
See strange example
for($i=1;$i<100000;++$i)
$db->prepare('insert into a values (?,?,?,?)');
After that print_r($db);
If a user is not experienced enough this approach will help to prevent the usage of great amounts of memory.
Expected result:
----------------
Minimization memory usage.