Subject: Re: bug#15555: Re: bug#15555: 24.3; Bidirectional display very slow with long lines

From: Dmitry Antipov <[email-masked]>
Date: Wed, 19 Feb 2014 09:48:21 +0400

On 02/18/2014 09:58 PM, Eli Zaretskii wrote:

> Is this still the same use case with your bug15555 function and the
> 4000.txt file?  If not, please describe this use case.

Yes.

There is a simple patch to trace bidi_shelve_cache/bidi_unshelve_cache and
two screencasts, with bug15555 over 2000.txt [1] and 4000.txt [2], respectively.

[1] http://37.139.80.10/tmp/2000.mkv
[2] http://37.139.80.10/tmp/4000.mkv

Dmitry

=== modified file 'src/bidi.c'
--- src/bidi.c	2014-01-01 17:44:48 +0000
+++ src/bidi.c	2014-02-19 04:07:08 +0000
@@ -62,6 +62,7 @@
 #include "buffer.h"
 #include "dispextern.h"
 #include "region-cache.h"
+#include "systime.h"
 
 static bool bidi_initialized = 0;
 
@@ -668,6 +669,8 @@
 	   + bidi_cache_idx * sizeof (struct bidi_it));
   databuf = xmalloc (alloc);
   bidi_cache_total_alloc += alloc;
+  fprintf (stderr, "%s [%f]: alloc %"pI"d bytes -> %p\n", __func__,
+	   timespectod (current_timespec ()), alloc, databuf);
 
   memcpy (databuf, &bidi_cache_idx, sizeof (bidi_cache_idx));
   memcpy (databuf + sizeof (bidi_cache_idx),
@@ -752,6 +755,8 @@
 	    -= (bidi_shelve_header_size
 		+ bidi_cache_idx * sizeof (struct bidi_it));
 	}
+      fprintf (stderr, "%s [%f]: free %p\n", __func__,
+	       timespectod (current_timespec ()), databuf);
 
       xfree (p);
     }