emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r107046: Speed up insertion of subpro


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107046: Speed up insertion of subprocess output on MS-Windows.
Date: Wed, 01 Feb 2012 18:51:20 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107046
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Wed 2012-02-01 18:51:20 +0200
message:
  Speed up insertion of subprocess output on MS-Windows.
  
   src/ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
   first 2 arguments are identical.  This makes inserting large
   output from a subprocess an order of magnitude faster on
   MS-Windows, where all sbrk'ed memory is always contiguous.
modified:
  src/ChangeLog
  src/ralloc.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-01-31 16:15:03 +0000
+++ b/src/ChangeLog     2012-02-01 16:51:20 +0000
@@ -1,3 +1,10 @@
+2012-02-01  Eli Zaretskii  <address@hidden>
+
+       * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
+       first 2 arguments are identical.  This makes inserting large
+       output from a subprocess an order of magnitude faster on
+       MS-Windows, where all sbrk'ed memory is always contiguous.
+
 2012-01-31  Glenn Morris  <address@hidden>
 
        * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:

=== modified file 'src/ralloc.c'
--- a/src/ralloc.c      2012-01-19 07:21:25 +0000
+++ b/src/ralloc.c      2012-02-01 16:51:20 +0000
@@ -636,7 +636,8 @@
             }
          else
            {
-             memmove (b->new_data, b->data, b->size);
+             if (b->new_data != b->data)
+               memmove (b->new_data, b->data, b->size);
              *b->variable = b->data = b->new_data;
             }
        }
@@ -647,7 +648,8 @@
        }
       else
        {
-         memmove (bloc->new_data, bloc->data, old_size);
+         if (bloc->new_data != bloc->data)
+           memmove (bloc->new_data, bloc->data, old_size);
          memset ((char *) bloc->new_data + old_size, 0, size - old_size);
          *bloc->variable = bloc->data = bloc->new_data;
        }
@@ -663,7 +665,8 @@
             }
          else
            {
-             memmove (b->new_data, b->data, b->size);
+             if (b->new_data != b->data)
+               memmove (b->new_data, b->data, b->size);
              *b->variable = b->data = b->new_data;
            }
        }
@@ -816,7 +819,8 @@
             header.  */
          for (b = last_bloc; b != NIL_BLOC; b = b->prev)
            {
-             memmove (b->new_data, b->data, b->size);
+             if (b->new_data != b->data)
+               memmove (b->new_data, b->data, b->size);
              *b->variable = b->data = b->new_data;
            }
 
@@ -862,7 +866,8 @@
 
          for (b = first_bloc; b != NIL_BLOC; b = b->next)
            {
-             memmove (b->new_data, b->data, b->size);
+             if (b->new_data != b->data)
+               memmove (b->new_data, b->data, b->size);
              *b->variable = b->data = b->new_data;
            }
        }


reply via email to

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