[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 0b3a0f3 1/6: Short-circuit substitutions for some s
From: |
Ken Raeburn |
Subject: |
[Emacs-diffs] master 0b3a0f3 1/6: Short-circuit substitutions for some simple types. |
Date: |
Wed, 21 Jun 2017 22:57:30 -0400 (EDT) |
branch: master
commit 0b3a0f30b288945e739f1ac7c2f9d8a2fdd352ac
Author: Ken Raeburn <address@hidden>
Commit: Ken Raeburn <address@hidden>
Short-circuit substitutions for some simple types.
Values that don't contain other values cannot be circular, so checking
for circular objects is a waste of cycles.
* src/lread.c (substitute_object_recurse): If the subtree being
examined is a symbol, number, or property-less string, just return
it.
---
src/lread.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/lread.c b/src/lread.c
index f849398..2636386 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3414,6 +3414,13 @@ substitute_object_recurse (Lisp_Object object,
Lisp_Object placeholder, Lisp_Obj
if (EQ (placeholder, subtree))
return object;
+ /* For common object types that can't contain other objects, don't
+ bother looking them up; we're done. */
+ if (SYMBOLP (subtree)
+ || (STRINGP (subtree) && !string_intervals (subtree))
+ || NUMBERP (subtree))
+ return subtree;
+
/* If we've been to this node before, don't explore it again. */
if (!EQ (Qnil, Fmemq (subtree, seen_list)))
return subtree;
- [Emacs-diffs] master updated (87a44b9 -> 85f6aa3), Ken Raeburn, 2017/06/21
- [Emacs-diffs] master 59f3c86 5/6: Create less garbage to collect while reading symbols., Ken Raeburn, 2017/06/21
- [Emacs-diffs] master 0b3a0f3 1/6: Short-circuit substitutions for some simple types.,
Ken Raeburn <=
- [Emacs-diffs] master 6af67b4 2/6: Reduce lread substitutions., Ken Raeburn, 2017/06/21
- [Emacs-diffs] master b914556 4/6: Replace read_objects assoc list with two hash tables., Ken Raeburn, 2017/06/21
- [Emacs-diffs] master efe200c 3/6: Use getc_unlocked., Ken Raeburn, 2017/06/21
- [Emacs-diffs] master 85f6aa3 6/6: Merge several Lisp reader speedups., Ken Raeburn, 2017/06/21