patchmake - Patches: patch #2777, speed up for the projects with big...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #2777: speed up for the projects with big number of long filenames

Submitter:  None
Submitted:  Wed 10 Mar 2004 08:03:04 AM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Originator Email:  -email is unavailable-
Open/Closed:  Closed Fixed Release:  CVS

Thu 18 Mar 2004 08:32:28 PM UTC, comment #1: 

I'm not sure which CVS archive you're looking at, but this patch has been in CVS for almost a year: it was committed on 25 March 2003.  Cheers!

Paul D. Smith <psmith>
Group administrator
Wed 10 Mar 2004 08:03:04 AM UTC, original submission:  

here is a great patch for make-3.80, which i have received as direct mail from one of `make' developers about one year ago.

This patch has made a dramatic speed up for the projects with incredibly big number of long filenames.

I was very happy about this. Now I am going to prepare the new working place for me and i see, that this patch is not checked in CVS tree!

Why?..

I think I shouldn't be the only happy person with this
speed boosting patch :)

Here it is:

------------------ PATCH BEGIN:
--- function.c~ 2002-10-23 01:36:49.000000000 -0400
+++ function.c 2002-12-05 01:13:33.000000000 -0500
@@ -87,13 +87,14 @@
      unsigned int slen, rlen;
      int by_word, suffix_only;
 {
-  register char *t = text;
-  register char *p;
+  char *t = text;
+  unsigned int tlen = strlen (text);
+  char *p;
 
   if (slen == 0 && !by_word && !suffix_only)
     {
       /* The first occurrence of "" in any string is its end.  */
-      o = variable_buffer_output (o, t, strlen (t));
+      o = variable_buffer_output (o, t, tlen);
       if (rlen > 0)
  o = variable_buffer_output (o, replace, rlen);
       return o;
@@ -107,11 +108,11 @@
  p = end_of_token (next_token (t));
       else
  {
-   p = sindex (t, 0, subst, slen);
+   p = sindex (t, tlen, subst, slen);
    if (p == 0)
      {
        /* No more matches.  Output everything left on the end.  */
-       o = variable_buffer_output (o, t, strlen (t));
+       o = variable_buffer_output (o, t, tlen);
        return o;
      }
  }
@@ -134,8 +135,12 @@
  /* Output the replacement string.  */
  o = variable_buffer_output (o, replace, rlen);
 
-      /* Advance T past the string to be replaced.  */
-      t = p + slen;
+      /* Advance T past the string to be replaced; adjust tlen.  */
+      {
+        char *nt = p + slen;
+        tlen -= nt - t;
+        t = nt;
+      }
     } while (*t != '\0');
 
   return o;
------------------ PATCH END.

best regards,
Valery A.Khamenya

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-03-18 psmith StatusNone Done
    Open/ClosedOpen Closed
    Fixed ReleaseNone CVS

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code