21
trabis
Re: First comments on 2.4
  • 2009/8/11 12:31

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


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'), 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.


22
voltan
Re: First comments on 2.4
  • 2009/8/11 12:53

  • voltan

  • Theme Designer

  • Posts: 724

  • Since: 2006/12/5


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

23
Mamba
Re: First comments on 2.4
  • 2009/8/11 14:19

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


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!!!

24
smithy
Re: First comments on 2.4
  • 2009/8/11 15:31

  • smithy

  • Just popping in

  • Posts: 3

  • Since: 2009/8/11


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

25
wishcraft
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..

26
voltan
Re: First comments on 2.4
  • 2009/8/12 10:02

  • voltan

  • Theme Designer

  • Posts: 724

  • Since: 2006/12/5


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 .

27
trabis
Re: First comments on 2.4
  • 2009/8/12 13:45

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


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 http://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 http://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.

28
trabis
Re: First comments on 2.4
  • 2009/8/12 15:02

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


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.

29
ghia
Re: First comments on 2.4
  • 2009/8/12 15:17

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


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.

30
trabis
Re: First comments on 2.4
  • 2009/8/12 15:31

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


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 http://www.xuups.com! Did you try http://www.xuups.com?

What should go on last char array? alphanum?

Ps: I found 12
[EDIT] I found 18

Login

Who's Online

313 user(s) are online (189 user(s) are browsing Support Forums)


Members: 0


Guests: 313


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits