From: Sven D. <Sve...@ho...> - 2006-02-03 00:29:49
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi guys, This is a patch to remove my stupid slowdown. Note that if you use $groups in %USERINFO it will take a while, but normal usage is fast. - ------------------- Index: lib/TWiki.pm =================================================================== - --- lib/TWiki.pm (revision 8674) +++ lib/TWiki.pm (working copy) @@ -3299,18 +3299,28 @@ my $user = $this->{user}; my $info = $format; - - my $username = $user->login(); - - my $wikiname = $user->wikiName(); - - my $wikiusername = $user->webDotWikiName(); - - my $emails = join(',', $user->emails()); - - my @groupNames = map {$_->webDotWikiName();} $user->getGroups(); - - my $groups = join(', ', @groupNames); + if ($info =~ /\$username/) { + my $username = $user->login(); + $info =~ s/\$username\b/$username/g; + } + if ($info =~ /\$wikiname/) { + my $wikiname = $user->wikiName(); + $info =~ s/\$wikiname\b/$wikiname/g; + } + if ($info =~ /\$wikiusername/) { + my $wikiusername = $user->webDotWikiName(); + $info =~ s/\$wikiusername\b/$wikiusername/g; + } + if ($info =~ /\$emails/) { + my $emails = join(',', $user->emails()); + $info =~ s/\$emails\b/$emails/g; + } + if ($info =~ /\$groups/) { + my @groupNames = map {$_->webDotWikiName();} $user->getGroups(); + my $groups = join(', ', @groupNames); + $info =~ s/\$groups\b/$groups/g; + } - - $info =~ s/\$username\b/$username/g; - - $info =~ s/\$wikiname\b/$wikiname/g; - - $info =~ s/\$wikiusername\b/$wikiusername/g; - - $info =~ s/\$emails\b/$emails/g; - - $info =~ s/\$groups\b/$groups/g; return $info; } - ---------------------------------------- Steffen Poulsen wrote: > Reported as http://develop.twiki.org/~develop/cgi-bin/view/Bugs/Item1572. > > // Steffen > > _____ > > Fra: twi...@li... [mailto:twi...@li...] På vegne af Steffen Poulsen > Sendt: 2. februar 2006 21:30 > Til: twi...@li... > Emne: SV: [TWiki-Dev] Announcement: TWiki 4.0.0 Production Release > > > Just reverting this and having the variables defined in TWikiPreferences instead doesn't do anything for speed (I belive you get get the same result)? > > I guess what is slowing things down is really the USERINFO code. > > // Steffen > > -- > > _____ > > Fra: twi...@li... [mailto:twi...@li...] På vegne af Martin@Cleaver.org > Sendt: 2. februar 2006 20:24 > Til: twi...@li... > Emne: Re: [TWiki-Dev] Announcement: TWiki 4.0.0 Production Release > > > As long as the TWiki.TWikiPreferences section is there I think its not needed. > > "in case users are upgrading without upgrading their TWikiPreferences" > > > > On 02/02/06, Steffen Poulsen <st...@td...> wrote: > > Hi Günther, > > Thank you for feedback - this happened r8613, and apparently made it below our radar - even Kenneths :-) > > - Don't know if this code can be made more efficient, or what can be done about it, though - any ideas .. Sven? CDot? Anyone? :-) > > // Steffen > > ------------------------------------------------------------------------ > r8613 | SvenDowideit | 2006-01-31 07:17:58 +0100 (Tue, 31 Jan 2006) | 1 line > > Item1537: added default handlers for the old USERNAME variables, in case users are upgrading without upgrading their TWikiPreferences > ------------------------------------------------------------------------ > > stitch$ svn diff -r8612:8613 > Index: lib/TWiki.pm > =================================================================== > --- lib/TWiki.pm (revision 8612) > +++ lib/TWiki.pm (revision 8613) > @@ -205,8 +205,11 @@ > URLPARAM => \&_URLPARAM, > LANGUAGE => \&_LANGUAGE, > USERINFO => \&_USERINFO, > + USERNAME => \&_USERNAME_deprecated, > VAR => \&_VAR, > WEBLIST => \&_WEBLIST, > + WIKINAME => \&_WIKINAME_deprecated, > + WIKIUSERNAME => \&_WIKIUSERNAME_deprecated > ); > $contextFreeSyntax{IF} = 1; > > @@ -3249,6 +3252,40 @@ > return $this->{templates}->expandTemplate('sep'); > } > > +#depercated functionality, now implemented using %USERINFO% > +#move to compatibility plugin in TWiki5 > +sub _WIKINAME_deprecated { > + my ( $this, $params ) = @_; > + ASSERT($this->isa( 'TWiki')) if DEBUG; > + > + $params->{format} = $this->{prefs}->getPreferencesValue( 'WIKINAME' ) || > + '%USERINFO{format="$wikiname"}%'; > + > + return $this->_USERINFO($params); > +} > +#depercated functionality, now implemented using %USERINFO% > +#move to compatibility plugin in TWiki5 > +sub _USERNAME_deprecated { > + my ( $this, $params ) = @_; > + ASSERT($this->isa( 'TWiki')) if DEBUG; > + > + $params->{format} = $this->{prefs}->getPreferencesValue( 'USERNAME' ) || > + '%USERINFO{format="$username"}%'; > + > + return $this->_USERINFO($params); > +} > +#depercated functionality, now implemented using %USERINFO% > +#move to compatibility plugin in TWiki5 > +sub _WIKIUSERNAME_deprecated { > + my ( $this, $params ) = @_; > + ASSERT($this->isa( 'TWiki')) if DEBUG; > + > + $params->{format} = $this->{prefs}->getPreferencesValue( 'WIKIUSERNAME' ) || > + '%USERINFO{format="$wikiusername"}%'; > + > + return $this->_USERINFO($params); > +} > + > sub _USERINFO { > my ( $this, $params ) = @_; > my $format = $params->{format} || '$username, $wikiusername, $emails'; > > > > // Steffen > > -- > > -----Oprindelig meddelelse----- > Fra: twi...@li... [mailto:twi...@li... ] På vegne af Günther Fischer > Sendt: 2. februar 2006 19:33 > Til: twi...@li... > Emne: Re: [TWiki-Dev] Announcement: TWiki 4.0.0 Production Release > > Hi Dev Community, > thank you for the new release. I was very optimistic to do the jump to > DakarRelease in the next time, > but there seems to be coding of the last days which slows down twiki. > The last "quick" was RC1, RC2 and the final 4.0 slows down. > I does a very simple test > > time wget --no-check-certificate > https://nordstrom.hrz.tu-chemnitz.de/wiki/bin/view/Main/WebHome and get > results with > > real 0m7.941s for 4.0 and > real 0m3.738s for the RC1 > > I have compared all the modules in lib/... and identifies the time > consumtion in lib/TWiki.pm, > copying the modules step by step and doing the wget. There are much > differences between RC1 and 4.0 > in TWiki.pm. Other ideas about performance? > > BTW: My twiki has 120 Webs with 11080 Topics. Should I split the Webs > of different user goups on different twikis? > > Guenther > ------------------------- > Peter Thoeny wrote: > > > Dear TWiki Dev Community: > > > > I will send out below e-mail to the twiki-announce list > > shortly. > > > > Regards, > > Peter > > > > ----- > > > > The long awaited TWiki 4.0.0 Production Release aka > > DakarRelease is available for download. This is a major > > release replacing TWiki version 04-Sep-2004. > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 > _______________________________________________ > TWiki-Dev mailing list > TWi...@li... > https://lists.sourceforge.net/lists/listinfo/twiki-dev > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642 > _______________________________________________ > TWiki-Dev mailing list > TWi...@li... > https://lists.sourceforge.net/lists/listinfo/twiki-dev > > > > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFD4qPrPAwzu0QrW+kRAkq2AJ4r5jK0SzqVZ9Yh0E/1MGJvzHHG7ACfbiX2 VmKgoCk6Kv3tdEhgvaToPWk= =bF6r -----END PGP SIGNATURE----- |