emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] emacs-24 r117502: Always use matched specpdl entry to


From: Dmitry Antipov
Subject: Re: [Emacs-diffs] emacs-24 r117502: Always use matched specpdl entry to record call arguments (Bug#18473).
Date: Tue, 16 Sep 2014 20:22:20 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1

On 09/16/2014 06:13 PM, Stefan Monnier wrote:

This will slow down every single function call.  Not by much, but
they're already pretty slow, so we should work hard not to make it worse.

IMO if we really care about speed in eval_sub, we should redesign this first:

  2111    if (SUBRP (fun))
  2112      {
  2113        Lisp_Object numargs;
  2114        Lisp_Object argvals[8];
  2115        Lisp_Object args_left;
  2116        register int i, maxargs;
  2117
  2118        args_left = original_args;
  2119        numargs = Flength (args_left);     <-- bad

Generic Flength is too slow due to monster if...else:

   121    if (STRINGP (sequence))
   122      XSETFASTINT (val, SCHARS (sequence));
   123    else if (VECTORP (sequence))
   124      XSETFASTINT (val, ASIZE (sequence));
   125    else if (CHAR_TABLE_P (sequence))
   126      XSETFASTINT (val, MAX_CHAR);
   127    else if (BOOL_VECTOR_P (sequence))
   128      XSETFASTINT (val, bool_vector_size (sequence));
   129    else if (COMPILEDP (sequence))
   130      XSETFASTINT (val, ASIZE (sequence) & PSEUDOVECTOR_SIZE_MASK);
   131    else if (CONSP (sequence))

and we know that args_left is always a list.

Dmitry




reply via email to

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