help-gnats
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fwd: gnatsweb/387: sub mark_urls can take over a minute to return for l


From: Dirk Bergstrom
Subject: [Fwd: gnatsweb/387: sub mark_urls can take over a minute to return for large PR]
Date: Tue, 04 Jun 2002 16:02:33 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0rc3) Gecko/20020523

i saw this PR, and decided it was time to put in my fix for mark_urls().
 a few months back i ported this routine to java, and in doing so found
a way to make it a lot cleaner.  i backported the fix to gnatsweb, and
added a set of config knobs which allow the administrator to switch the
three kinds of htmlifying (urls, emails & prs) on & off, and to limit
the size of strings processed.

testing the change on a PR with a 1 MB audit trail, i find that the new
version takes about the same amount of time as the old version, 15
seconds (oh well...), but setting the maximum mark_urls size to 100K (so
that it won't htmlify the audit trail) knocks processing time down by
1/3, to 10 seconds.  i did some quick experiments turning off each type
of marking, and it looks like htmlifying PR links takes slightly longer
than the others, but interestingly, doing one pass takes about the same
amount of time as doing all three passes (perhaps perl study()'s the
string the first time through?).

i couldn't get it to take a minute using mozilla, but using IE 6.0, my
desktop machine locked up for over a minute with the cpu pegged at 100%,
whether or not i had mark_urls turned on.  looks like some of this PR
can be blamed on microsoft...

-------- Original Message --------
Subject: gnatsweb/387: sub mark_urls can take over a minute to return
for large PR
Date: Mon, 03 Jun 2002 19:16:56 -0400
From: address@hidden
Reply-To: address@hidden
To: address@hidden, address@hidden, address@hidden



>Number:         387
>Category:       gnatsweb
>Synopsis:       sub mark_urls can take over a minute to return for large PR
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 03 19:16:55 -0400 2002
>Originator:     address@hidden
>Release:        v3.99.2 v40-beta1
>Organization:

>Environment:

linux PC with Apache
browser IE 5.50
>Description:

Despite our recommendation, we've had user putting large
device log file with PR description instead of making
it an attachment.

We were then finding that PRs with large log files one
example was:
-rw-r--r--    1 gnats    gnats      549458 May 30 19:57 4443

This PR would take just over a Minute to load in the browser.

I debugged through the perl code and was seeing that
the sub mark_urls was were all the time was spend...about
1 min just here.

This is a nice feature to mark email, urls, etc to be
a click away, but not worth the minute to get the PR.

I commented this line out and it now loads in about a sec
or less.

I'd recommend either writing this to be a little faster
(like do it in a single pass) or simply remove it.






# takes a string,
# attempts to make urls, PR references and email addresses in that
string into
# links:
# 'foo bar address@hidden flibbet PR# 1234 and furthermore
#  http://www.abc.com/whatever.html'
# is returned as:
# 'foo bar address@hidden <mailto:address@hidden> flibbet
#   PR# 1234
<http://site.com/cgi-bin/gnats?cmd=view;pr=1234;database=default>
#
#   http://www.abc.com/whatever.html <http://www.abc.com/whatever.html>'
# returns the (possibly) modified string
# since we need to make three passes over the string, and the results of
# one pass would be fodder for another pass (ie. the PR url in a href
# would trigger the url matcher), we put each created link into an array,
# and substitute in a placeholder.
# after we've done all the link substitutions, we go back and replace the
# placeholders with the cached links from the array.
# it might be possible to order the substitutions so that they didn't
# step on each other (urls, then mailto:s, then PRs), but this fails
# when presented with ftp urls which include a username:
# ftp://address@hidden/pub/foo/bar.gz
sub mark_urls {
>How-To-Repeat:

>Fix:
file:  gnatsweb.pl

sub view

      } else {
          # make urls and email addresses into live hrefs
          $val = mark_urls($val);
      }

simple comment out:
#$val = mark_urls($val);
>Unformatted:


_______________________________________________
Gnats-prs mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/gnats-prs


-- 
Dirk Bergstrom                   address@hidden
Computer Geek                     v: 707.433.0564
Juniper Networks Inc.             f: 707.433.0769

"it *looks* like a nail; lemme grab my hammer..."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]