lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev dev.10 progress


From: Leonid Pauzner
Subject: lynx-dev dev.10 progress
Date: Mon, 18 Nov 2002 21:53:06 +0300 (MSK)

18-Nov-2002 06:20 Thomas E. Dickey wrote:
> decide if it's too much trouble to get people to do it).  Yesterday I
> caught up with patches and started working on the remaining stuff I
> intended fixing for dev.10.  The catch-up portion is in
> ftp://invisible-island.net/temp (that doesn't include the changes I'm
> working on for pathnames - I'll probably snapshot a patch tonight with
> that part).


Minor corrections aganst your patch (reorganize wording in changes,
remove two unused functions, correct condition before FREE(fragment);



diff -u -p -r -w LYNX2-8-.59D/changes LYNX2-8-.59F/changes
--- LYNX2-8-.59D/changes        Mon Nov 18 19:50:10 2002
+++ LYNX2-8-.59F/changes        Mon Nov 18 21:43:42 2002
@@ -5,45 +5,47 @@ Changes since Lynx 2.8 release
 + HTTCP.c patch to make djgpp/Watt-32 non-blocking connect in HTDoConnect().
   This allows pressing 'z' to abort connections.  Removed extra _HTProgress()
   for INET6; it overwrote previous progress message -GV, DK
-+ optimization for parsing html with many relative links, href="#fragment" -
-  HTAnchor_findChildAndLink() and HTML_start_element(), case HTML_A:  now avoid
-  significant overhead when link == LINK_INTERNAL (e.g., resolving against
-  base, lots of reallocations, parent lookup, etc., all are useless).  Two
-  functions affected.  [HTAnchor.c, HTML.c].  The code works both with and
-  without DONT_TRACK_INTERNAL_LINKS symbol -LP
-+ in SGML.c, element stack now use a pool of just 10 elements to avoid most of
++ in SGML.c, element stack now use a pool of 10 elements to avoid most of
   malloc/free calls -LP
 + in HTParse(), use single alloca instead of three malloc/free pairs -LP
-+ add DJGPP to SINGLE_USER_UNIX special cases -DK
-+ remove obsolete next_anchor() function -LP
++ in HTParse.c, avoid most strcasecomp calls in scan() - LP
 + modify GridText.c to store lines, anchors, and forms in the same HText memory
   pool as styles.  This will optimize memory allocation/deallocation by 8Kb
   units.  The down side:  lines in TRST mode will be stored twice.  Some
   structs are made a bit more compact -LP
++ add DJGPP to SINGLE_USER_UNIX special cases -DK
 + modify configure script to not strip the -g option from $CFLAGS if it was
   present in the user's environment rather than autoconf adding it (report by
   DK) -TD
 + add --with-curses-dir configure script option -TD
-+ eliminate 1/3 heavy HTParse() calls (HTAnchor.c, HTParse.[c,h]) -LP
 + in SGMLFindTag, we translate string uppercase in-place and launch case
   insensitive search, add SGMLFindUprTag() to cover the cases where the string
   is readonly - LP, TD
-+ a *big* optimization for large HTML files - with thousands of links - remove
-  quadratic complexity from split_line() usage (in GridText.c).  Because of
-  some work with anchors on the last(=split) line, the anchors list was
-  traversed from the beginning for each output line.  Now first_anchor is a
-  double-linked list (since reverse search appears), so we can walk from the
-  last_anchor easily.  With my 800Kb test file (13000 output lines, 3100
-  anchors) this shows 25% speedup:  split_line weight decreased from 26% down
-  to 1% -LP
 + DJGPP build restored.  MV_PATH was undefined long ago by mistake.  Fix recent
   DJGPP changes in HTTCP.c:  move _resolve_hook few lines below, it will not
   compile otherwise.  Remove minor warnings -LP
-+ optimization for large HTML files - with thousands of links - remove
-  quadratic complexity when generating a 'l'ist page, now traverse once
-  (linear).  Not too much savings but trivial.  -LP
-+ optimize calls to HTAnchor_findChild() by replacing the linked list of
-  anchors with a tree -LP
++ optimize parsing html with many relative links, href="#fragment" -
+  HTAnchor_findChildAndLink() and HTML_start_element(), case HTML_A:  now avoid
+  significant overhead when link == LINK_INTERNAL (e.g., resolving against
+  base, lots of reallocations, parent lookup, etc., all are useless).  Two
+  functions affected.  [HTAnchor.c, HTML.c].  The code works both with and
+  without DONT_TRACK_INTERNAL_LINKS symbol -LP
++ optimize parsing of large html files - with thousands of anchors - LP
+  + remove quadratic complexity from split_line() usage [GridText.c].
+    Because of some work with anchors on the last(=splitted) line,
+    the anchors list was traversed from the beginning for each output line.
+    Now we store last_anchor_before_split  explicitly.
+    With my 800Kb test file (13000 output lines, 3100 anchors) this shows
+    25% speedup: split_line() weight decreased from 26% down to 1%
+  + remove quadratic complexity from HTAnchor_findChild() usage [HTAnchor.c].
+    HTParentAnchor::children list was traversed zillion times, now we
+    split it into a tree (named anchors <a name=...>, fast search required)
+    and a list (just a storage for the rest anchors, no search required).
+    This one gives 11% speedup for 3100 anchors html on my system.
+  + remove quadratic complexity when generating a 'l'ist page,
+    now traverse anchors list only once [LYList.c, GridText.c].
+    Not too much savings but trivial.
++ add a search method to HTBTree implementation. - LP
 + amend check for refresh-URL to avoid adding a link if the retrieved page is
   compressed, since the link would be added to the compressed file, corrupting
   it (reported by Michel SUCH and Karl-Heinz Weirich <address@hidden>) -TD
diff -u -p -r -w LYNX2-8-.59D/www/library/implemen/htanchor.c 
LYNX2-8-.59F/www/library/implemen/htanchor.c
--- LYNX2-8-.59D/www/library/implemen/htanchor.c        Mon Nov 18 19:51:00 2002
+++ LYNX2-8-.59F/www/library/implemen/htanchor.c        Mon Nov 18 21:33:24 2002
@@ -291,7 +291,7 @@ PUBLIC HTChildAnchor * HTAnchor_findChil
        if (*fragment)
            dest = (HTParentAnchor *)HTAnchor_findChild(dest, fragment);

-       if (ltype != LINK_INTERNAL)
+       if (!(*href == '#' && ltype == LINK_INTERNAL))
            FREE(fragment);

 #define DUPLICATE_ANCHOR_NAME_WORKAROUND
@@ -947,12 +947,6 @@ PUBLIC BOOL HTAnchor_isISMAPScript ARGS1
        HTAnchor *,     me)
 {
     return( me ? me->parent->isISMAPScript : NO);
-}
-
-PUBLIC BOOL HTAnchor_hasChildren ARGS1(
-       HTParentAnchor *,       me)
-{
-    return (BOOL) ( me ? (me->children || !HTList_isEmpty(me->children_notag)) 
: NO);
 }

 #if defined(USE_COLOR_STYLE)
diff -u -p -r -w LYNX2-8-.59D/www/library/implemen/htanchor.h 
LYNX2-8-.59F/www/library/implemen/htanchor.h
--- LYNX2-8-.59D/www/library/implemen/htanchor.h        Mon Nov 18 19:51:00 2002
+++ LYNX2-8-.59F/www/library/implemen/htanchor.h        Mon Nov 18 20:55:56 2002
@@ -234,9 +234,6 @@ extern BOOL HTAnchor_isIndex PARAMS((
 extern BOOL HTAnchor_isISMAPScript PARAMS((
        HTAnchor *              me));

-extern BOOL HTAnchor_hasChildren PARAMS((
-       HTParentAnchor *        me));
-
 #if defined(USE_COLOR_STYLE)
 extern CONST char * HTAnchor_style PARAMS((
        HTParentAnchor *        me));
diff -u -p -r -w LYNX2-8-.59D/www/library/implemen/htparse.c 
LYNX2-8-.59F/www/library/implemen/htparse.c
--- LYNX2-8-.59D/www/library/implemen/htparse.c Mon Nov 18 19:51:00 2002
+++ LYNX2-8-.59F/www/library/implemen/htparse.c Mon Nov 18 20:52:22 2002
@@ -471,28 +471,6 @@ PUBLIC char * HTParse ARGS3(
 }


-PUBLIC char * HTParseAnchor ARGS1(  /* fast HTParse() specialization */
-       CONST char *,   aName)
-{
-    if (!aName)
-       return 0;
-
-    if (!strncasecomp(aName, "http://";, 7)
-     || !strncasecomp(aName, "file://", 7)
-     || !strncasecomp(aName, "https://";, 8)) { /* fast way */
-       CONST char * p;
-       for (p = aName; *p && *p != '#'; p++)
-           ;
-       if (*p++) {
-           char * res = 0;
-           StrAllocCopy(res, p);
-           return res;
-       }
-       return 0;
-    }
-    return HTParse(aName, "", PARSE_ANCHOR);  /* may have unescaped hashes */
-}
-
 /*     Simplify a filename.                            HTSimplify()
 **     --------------------
 **
diff -u -p -r -w LYNX2-8-.59D/www/library/implemen/htparse.h 
LYNX2-8-.59F/www/library/implemen/htparse.h
--- LYNX2-8-.59D/www/library/implemen/htparse.h Mon Nov 18 19:51:00 2002
+++ LYNX2-8-.59F/www/library/implemen/htparse.h Mon Nov 18 20:52:00 2002
@@ -70,9 +70,6 @@ extern char * HTParse PARAMS((
        CONST char *    relatedName,
        int             wanted));

-extern char * HTParseAnchor PARAMS((  /* fast HTParse() specialization */
-       CONST char *    aName));
-
 /*     Simplify a filename.                            HTSimplify()
 **     --------------------
 **


; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

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