xoops forums

trabis

Core Developer
Posted on: 2009/8/11 12:31
trabis
trabis (Show more)
Core Developer
Posts: 2268
Since: 2006/9/1 1
#21

Re: First comments on 2.4

Quote:

wishcraft wrote:
There is no hashing overhead trabis, i am running it on 2.4.0 on 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'), falsefalse); //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.

voltan

Theme Designer
Posted on: 2009/8/11 12:53
voltan
voltan (Show more)
Theme Designer
Posts: 724
Since: 2006/12/5
#22

Re: First comments on 2.4

Quote:
- Some tooltips have misspelled words "whit blocks". I can provide a full list later on as I find them.


my English language is terrible . one person most edit English file

Quote:
- In List groups, the column width group ID is bigger then any other (click on groups from control panel).


yes . it's my mistake in styles . I will fix it for final version

Mamba

Moderator
Posted on: 2009/8/11 14:19
Mamba
Mamba (Show more)
Moderator
Posts: 10779
Since: 2004/4/23
#23

Re: First comments on 2.4

Quote:
my English language is terrible . one person most edit English file

the "wiht" has been fixed in SVN.
I'll look into your other English files.

But don't worry about your English - we have enough of English speakers who can help us with the English files. Your programming skills are way more important for us!!!

smithy

Just popping in
Posted on: 2009/8/11 15:31
smithy
smithy (Show more)
Just popping in
Posts: 3
Since: 2009/8/11
#24

Re: First comments on 2.4

can somebody sort wishcrafts signature out, it takes up most of the page and is excessive promotion

wishcraft

Module Developer
Posted on: 2009/8/11 16:29
wishcraft
wishcraft (Show more)
Module Developer
Posts: 3710
Since: 2007/5/18
#25

Re: First comments on 2.4

Well smithy, hmm... I have changed it to 2-col now, well you know one good thing is the amount of people in XOOPS that use xsoap to talk to XOOPS via the facebook php markup language to run apps, well you don't know how much facebook there is in things..

voltan

Theme Designer
Posted on: 2009/8/12 10:02
voltan
voltan (Show more)
Theme Designer
Posts: 724
Since: 2006/12/5
#26

Re: First comments on 2.4

Quote:
- In List groups, the column width group ID is bigger then any other (click on groups from control panel).


its fixed in svn

problem is here:

.head {
    
background-color#AFAFAF;
    
padding5px;
    
font-weightbold;
    
width60%;
}


width: 60%; is problem .

trabis

Core Developer
Posted on: 2009/8/12 13:45
trabis
trabis (Show more)
Core Developer
Posts: 2268
Since: 2006/9/1 1
#27

Re: First comments on 2.4

Quote:

ghia wrote:
Did not yet test with 2.4, but in 2.3.3 there is an error when automatic converting hostnames to links. You mention eg www.myhost.com and without url tags it becomes a link anyway. When you mention the site at the end of a sentence as in
Have a look at www.mysite.com.
then the full stop (point) is taken also in the link, which makes the link unreachable. Probably a bad regexp.


Quote:

function makeClickable(&$text)
{
$valid_chars = "a-z0-9\/\-_+=.~!%@?#&;:$\|";
$patterns = array("/(^|[^]_a-z0-9-=\"'\/])([a-z]+?):\/\/([{$valid_chars}]+)/ei" , "/(^|[^]_a-z0-9-=\"'\/])www\.([a-z0-9\-]+)\.([{$valid_chars}]+)/ei" , "/(^|[^]_a-z0-9-=\"'\/])ftp\.([a-z0-9\-]+)\.([{$valid_chars}]+)/ei" , "/(^|[^]_a-z0-9-=\"'\/:\.])([a-z0-9\-_\.]+?)@([{$valid_chars}]+)/ei");
$replacements = array("'\\1\\2://'.MyTextSanitizer::truncate( '\\3' ).''" , "'\\1'.MyTextSanitizer::truncate( 'www.\\2.\\3' ).''" , "'\\1'.MyTextSanitizer::truncate( 'ftp.\\2.\\3' ).''" , "'\\1'.MyTextSanitizer::truncate( '\\2@\\3' ).''");
return preg_replace($patterns, $replacements, $text);
}


Can you fix it? This is Chinese to me.

trabis

Core Developer
Posted on: 2009/8/12 15:02
trabis
trabis (Show more)
Core Developer
Posts: 2268
Since: 2006/9/1 1
#28

Re: First comments on 2.4

I've removed ERM from SVN and updated xuups.com

With XOOPS 2.4 beta (ERM) the best time I got was 2.842 seconds
With XOOPS 2.4 beta2 (without ERM) the best time I got was 0.436 seconds

Please keep on testing.

ghia

Community Support Member
Posted on: 2009/8/12 15:17
ghia
ghia (Show more)
Community Support Member
Posts: 4954
Since: 2008/7/3 1
#29

Re: First comments on 2.4

Try with:
Quote:
function makeClickable(&$text)
{
$valid_chars = "a-z0-9\/\-_+=.~!%@?#&;:$\|";
$end_chars = "a-z0-9\/\-_+=~!%@?#&;:$\|";
$patterns = array(
"/(^|[^]_a-z0-9-=\"'\/])([a-z]+?):\/\/([{$valid_chars}]+[{$end_chars}])/ei" ,
"/(^|[^]_a-z0-9-=\"'\/])www\.([a-z0-9\-]+)\.([{$valid_chars}]+[{$end_chars}])/ei" ,
"/(^|[^]_a-z0-9-=\"'\/])ftp\.([a-z0-9\-]+)\.([{$valid_chars}]+[{$end_chars}])/ei" ,
"/(^|[^]_a-z0-9-=\"'\/:\.])([a-z0-9\-_\.]+?)@([{$valid_chars}]+[{$end_chars}])/ei"
);
$replacements = array(
"'\\1\\2://'.MyTextSanitizer::truncate( '\\3' ).''" ,
"'\\1'.MyTextSanitizer::truncate( 'www.\\2.\\3' ).''" ,
"'\\1'.MyTextSanitizer::truncate( 'ftp.\\2.\\3' ).''" ,
"'\\1'.MyTextSanitizer::truncate( '\\2@\\3' ).''"
);
return preg_replace($patterns, $replacements, $text);
}

also very ennoying is that this kind of code in no way is presentable in a code block:
function makeClickable(&$text)
{
$valid_chars "a-z0-9/-_+=.~!%@?#&;:$|";
$end_chars "a-z0-9/-_+=~!%@?#&;:$|";
$patterns = array(
  
"/(^|[^]_a-z0-9-="'/])([a-z]+?)://([{$valid_chars}]+[{$end_chars}])/ei" ,
  "/(^|[^]_a-z0-9-="'
/])www.([a-z0-9-]+).([{$valid_chars}]+[{$end_chars}])/ei" ,
  "
/(^|[^]_a-z0-9-="'/])ftp.([a-z0-9-]+).([{$valid_chars}]+[{$end_chars}])/ei" ,
  
"/(^|[^]_a-z0-9-="'/:.])([a-z0-9-_.]+?)@([{$valid_chars}]+[{$end_chars}])/ei"
  );
$replacements = array(
  "'
\1\2://'.MyTextSanitizer::truncate( '\3' ).''" ,
  
"'\1'.MyTextSanitizer::truncate( 'www.\2.\3' ).''" ,
  
"'\1'.MyTextSanitizer::truncate( 'ftp.\2.\3' ).''" ,
  
"'\1'.MyTextSanitizer::truncate( '\2@\3' ).''"
  
);
return 
preg_replace($patterns$replacements$text);
}
Puzzle: Seek the 7? differences.

trabis

Core Developer
Posted on: 2009/8/12 15:31
trabis
trabis (Show more)
Core Developer
Posts: 2268
Since: 2006/9/1 1
#30

Re: First comments on 2.4

Hey it works! But I had to use the original replacement array because the one I posted was changed by the script itself, lol.

Now the problem: what if my last char is ! or ?

I could say please visit my site www.xuups.com! Did you try www.xuups.com?

What should go on last char array? alphanum?

Ps: I found 12
[EDIT] I found 18