bug-zile
[Top][All Lists]
Advanced

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

Re: [Bug-zile] Incremental search is dog slow in moderately-sized files


From: Reuben Thomas
Subject: Re: [Bug-zile] Incremental search is dog slow in moderately-sized files
Date: Sat, 18 Jan 2014 08:53:17 +0000

On 18 January 2014 05:26, Gary V. Vaughan <address@hidden> wrote:

On Jan 18, 2014, at 4:03 PM, Gary V. Vaughan <address@hidden> wrote:
> [[...]] the only thing I can think of is to add bi-directional char buffer searches into alien itself, with a fallback memrchr function incase the host libc lacks one.

This speeds things up drastically for me - though most likely still an order of magnitude slower than memrchr in libc:

  local function memrchr (buf, ch, o)
    local c = string.byte (ch)
    for i = o, 1, -1 do
      if buf[i] == c then return i end
    end
  end

I'll push that change presently as it's a definite improvement.  What I'd really like is a way to check whether alien.default.memrchr will work or not; but even wrapped in pcall() it crashes out before returning.  Is there a way to check for a symbol in alien?

Isn't this what configure is for? But since memrchr should be in libc, you can test for the existence of alien.default.memrchr.

As for a C implementation, you could have a fallback that is compiled into a C module if necessary, but this is what libposix is for, surely?

--
http://rrt.sc3d.org

reply via email to

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