emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 56a3e4a: Tweak performance of cmpfn_profiler


From: Paul Eggert
Subject: [Emacs-diffs] master 56a3e4a: Tweak performance of cmpfn_profiler
Date: Tue, 23 Jul 2019 01:09:32 -0400 (EDT)

branch: master
commit 56a3e4a5d366a8453608d9a604ebd5ddb4e52245
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Tweak performance of cmpfn_profiler
    
    * src/profiler.c (cmpfn_profiler):
    Improve performance when VECTORP (bt1) && EQ (bt1, bt2).
---
 src/profiler.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/profiler.c b/src/profiler.c
index ed0e9dd..6b482ab 100644
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -530,7 +530,9 @@ the same lambda expression, or are really unrelated 
function.  */)
 static Lisp_Object
 cmpfn_profiler (Lisp_Object bt1, Lisp_Object bt2, struct Lisp_Hash_Table *h)
 {
-  if (VECTORP (bt1) && VECTORP (bt2))
+  if (EQ (bt1, bt2))
+    return Qt;
+  else if (VECTORP (bt1) && VECTORP (bt2))
     {
       ptrdiff_t l = ASIZE (bt1);
       if (l != ASIZE (bt2))
@@ -541,7 +543,7 @@ cmpfn_profiler (Lisp_Object bt1, Lisp_Object bt2, struct 
Lisp_Hash_Table *h)
       return Qt;
     }
   else
-    return EQ (bt1, bt2) ? Qt : Qnil;
+    return Qnil;
 }
 
 static Lisp_Object



reply via email to

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