[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/raeburn-startup 04b9ff6 03/17: Short-circuit subst
From: |
Ken Raeburn |
Subject: |
[Emacs-diffs] scratch/raeburn-startup 04b9ff6 03/17: Short-circuit substitutions for some simple types. |
Date: |
Thu, 15 Dec 2016 11:33:17 +0000 (UTC) |
branch: scratch/raeburn-startup
commit 04b9ff66e9ffdc12401df58b2f1670b423724a1d
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 2d87c4c..74d9dfb 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3359,6 +3359,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] branch scratch/raeburn-startup created (now 6a7d996), Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 04b9ff6 03/17: Short-circuit substitutions for some simple types.,
Ken Raeburn <=
- [Emacs-diffs] scratch/raeburn-startup 3b47eb4 02/17: Reduce lread substitutions., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 3dd6aa7 13/17: Create *Messages* buffer when loading dumped data., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup f48e12c 06/17: Reduce nested calls during substitution., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 702bcad 15/17: Don't memset storage we're about to fill anyway., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup c95f727 16/17: Dump defvars for special variables only., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 8e7ec27 07/17: Use a hash table for seen_list, similar to read_objects_map., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup dcc4b55 04/17: Replace read_objects assoc list with two hash tables., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 8f37b82 08/17: Stefan's patch to write out and load "dumped.elc"; Oct 31 version., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 872c9f6 05/17: Don't generate excessive hash tables during reads., Ken Raeburn, 2016/12/15
- [Emacs-diffs] scratch/raeburn-startup 44f3368 11/17: Force purification off when using dumped.elc., Ken Raeburn, 2016/12/15