LMPX.COM |
Home | Linux | Mysql | PHP | XML | ||
|
|
|||
From: shire Date: Sun Jun 29 12:33:36 2008 Subject: RFC: APCIterator class
Here is a rough patch of what I have currently in my working copy for
an APCIterator class. Check out the tests for some examples but it
looks something like:
<?php
$it = new APCIterator('user', $regex, $chunk_size);
foreach($it as $key=>$value) {
echo $key."\n";
}
?>
Some code probably needs to be cleaned up and I need to add a delete
() method along with the ability to only dump entry values rather
than the full entry info (which it does by default currently).
Locking names also conflict with sma.c which I'll need to resolve.
The primary purpose here is to allow iterating large caches in
$chunk_size steps, grabbing $chunk_size entries per lock instance so
it free's the cache locks for other activity rather than holding up
the entire cache to grab the first 100 entries or the first 100
entries matching a regex. Regex is also moved into the C level so
it's faster than grabbing all the entries and iterating over them in
PHP arrays as is currently required.
-shire
http://tekrat.com/patches/apc_iterator.patch
| Navigate in group php.apc.dev at sever news.php.net | |
| Previous | Next |
| © No Copyright You are free to use Anything |
Site Maintained by PHP Developer
Powered By PHP Consultants |