• Paul Eggert's avatar
    A quicker check for quit · 1392ec74
    Paul Eggert authored
    On some microbenchmarks this lets Emacs run 60% faster on my
    platform (AMD Phenom II X4 910e, Fedora 25 x86-64).
    * src/atimer.c: Include keyboard.h, for pending_signals.
    * src/editfns.c (Fcompare_buffer_substrings):
    * src/fns.c (Fnthcdr, Fmemq, Fmemql, Fassq, Frassq, Fplist_put)
    (Fnconc, Fplist_member):
    Set and clear immediate_quit before and after loop instead of
    executing QUIT each time through the loop.  This is OK for loops
    that affect only locals.
    * src/eval.c (process_quit_flag): Now static.
    (maybe_quit): New function, containing QUIT’s old body.
    * src/fns.c (rarely_quit): New function.
    (Fmember, Fassoc, Frassoc, Fdelete, Fnreverse, Freverse)
    (Flax_plist_get, Flax_plist_put, internal_equal, Fnconc):
    Use it instead of QUIT, for
    speed in tight loops that might modify non-locals.
    * src/keyboard.h (pending_signals, process_pending_signals):
    These belong to keyboard.c, so move them here ...
    * src/lisp.h: ... from here.
    (QUIT): Redefine in terms of the new maybe_quit function, which
    contains this macro’s old definiens.  This works well with branch
    prediction on processors with return stack buffers, e.g., x86
    other than the original Pentium.
    1392ec74
lisp.h 147 KB