21
Quote:
wishcraft wrote:
There is no hashing overhead trabis, i am running it on 2.4.0 on http://www.chronolabs.org.au, it has 32mbs, all the hashing adds is 44 bytes of data to the total object size, how could that overhead anything.
Looking at timers in XOOPS logger:
Using ERM
XOOPS took 1,647 seconds to load
Memory used : 5.932.824 bytes
Comenting out the hashing routines inside ERM class:
Xoops took 0,290 seconds to load
Memory used : 5.910.216 bytes
This was tested on a live site with a lot of blocks in front page.
But there is a bigger problem. Look at this piece of code:
include_once XOOPS_ROOT_PATH . '/kernel/user.php';
$member_handler = new XoopsUserHandler($GLOBALS['xoopsDB']);
$criteria = new Criteria('level', 0, '>');
$members = $member_handler->getAll($criteria, array('uname', 'email'), false, false); //Using this to not exaust server resources
unset($criteria);
foreach ($members as $member) {
$waiting = $wt_handler->create();
$vars['wt_toname'] = $member['uname'];
$vars['wt_toemail'] = $member['email'];
$vars['wt_subject'] = str_replace("{NAME}", $vars['wt_toname'], $subject);
$vars['wt_subject'] = str_replace("{EMAIL}", $vars['wt_toemail'], $vars['wt_subject']);
$vars['wt_body'] = str_replace("{NAME}", $vars['wt_toname'], $body);
$vars['wt_body'] = str_replace("{EMAIL}", $vars['wt_toemail'], $vars['wt_body']);
$waiting->setVars($vars);
if (!$wt_handler->insert($waiting)) {
$error == true;
}
unset($waiting);
}
unset($members);
I use getAll and I limit the fields to use less memory has possible. This code works fast and fine in 2.3 but it takes ages to load in 2.4(with ERM). In fact it does not finish loading, after we meet the execution limit time(30 seconds) we get a blank page.
Why? This site has 6000 users and ERM is hashing every object. This overhead is not acceptable.