[Top][All Lists]

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

Re: Long lines and bidi

From: Paul Eggert
Subject: Re: Long lines and bidi
Date: Fri, 08 Feb 2013 19:34:20 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2

On 02/08/2013 08:52 AM, Eli Zaretskii wrote:
>> > So, ~90% of time spent in scan_buffer is:
>> > 
>> > 799                while (*cursor != target && --cursor >= ceiling_addr)
>> > 800                  ;

> Which cannot be optimized.

It can be sped up somewhat, by using memrchr.

This won't solve these performance issues, but it helps:
on my platform (x86-64 Ubuntu 12.10) I ran Dmitry's scroll-both benchmark
on a real file (the trunk's src/xdisp.c), and it was 25% faster overall
(1.19 seconds versus 1.49 seconds) when I used memrchr there
and memchr for forward searches.

I'll attach the patch I used.  Eli, it'll need a bit of hacking to
port to MS-Windows, since the substitute memrchr implementation
(which is supplied) will need to be compiled.

Dmitry, is this something you can easily try with your benchmarks?

Most of the attached patch is boilerplate taken unmodified from gnulib,
to support memrchr on non-GNU platforms.  The key part of the change is
at the end, to src/search.c.

Attachment: memchr.txt
Description: Text document

reply via email to

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