emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/ebdb 2fa4379 14/21: New option ebdb-try-speedups


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 2fa4379 14/21: New option ebdb-try-speedups
Date: Sun, 17 Sep 2017 15:32:47 -0400 (EDT)

branch: externals/ebdb
commit 2fa437987a34a902959fadc3be02710399643955
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    New option ebdb-try-speedups
    
    Addresses #53
    
    * ebdb.el (ebdb-try-speedups): Do "risky things" in an effort to make
      EBDB go faster. Right now all that means is setting
      eieio-skip-typecheck to t while loading, but other tricks could be
      governed by this option in the future.
    * ebdb.org: Document.
    * ebdb.texi: etc
    * ebdb.info: etc
---
 ebdb.el   |  18 ++++++++++-
 ebdb.info | 106 ++++++++++++++++++++++++++++++++++----------------------------
 ebdb.org  |  10 ++++++
 ebdb.texi |  10 ++++++
 4 files changed, 95 insertions(+), 49 deletions(-)

diff --git a/ebdb.el b/ebdb.el
index d31ec17..fad9363 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -176,6 +176,14 @@ Organization names are currently hard-coded to use
   :group 'ebdb-eieio
   :type 'class)
 
+(defcustom ebdb-try-speedups nil
+  "When non-nil, try to speed up loading by disabling checks.
+This will set `eieio-skip-typecheck' when loading databases.  The
+type checks are done for a reason, it's possible this might lead
+to errors or database corruption."
+  :group 'ebdb-eieio
+  :type 'boolean)
+
 (defgroup ebdb nil
   "The Insidious Big Brother Database."
   :group 'news
@@ -4880,13 +4888,21 @@ Do this only if `ebdb-check-postcode' is non-nil."
 
 ;;; Reading and Writing the EBDB
 
+;; Loading and initialization is slow.  Mostly loading.  In my own
+;; case, setting `eieio-skip-typecheck' to t dropped overall load
+;; times from 2.5 seconds to 2 seconds.  Otherwise, if we want to find
+;; further speedups, we could try overriding `object-write' for ebdb
+;; classes and see if it's possible to write an object that can be
+;; read faster.
+
 ;;;###autoload
 (defun ebdb-load ()
   "Load all databases listed in `ebdb-sources'.  All the
 important work is done by the `ebdb-db-load' method."
   (let ((sources (if (listp ebdb-sources)
                     ebdb-sources
-                  (list ebdb-sources))))
+                  (list ebdb-sources)))
+       (eieio-skip-typecheck ebdb-try-speedups))
     ;; Check if we're re-loading.
     (when (and ebdb-db-list
               (object-assoc t 'dirty ebdb-db-list))
diff --git a/ebdb.info b/ebdb.info
index b8ca680..3e601aa 100644
--- a/ebdb.info
+++ b/ebdb.info
@@ -277,6 +277,13 @@ buffers, which runs ‘ebdb-save’.  By default, EBDB also 
installs
 ‘ebdb-save’ as part of the ‘kill-emacs-hook’.  Set
 ‘ebdb-install-save-hook’ to nil to prevent this.
 
+   Loading and initializing the EBDB can be slow for large databases.
+If you find yourself annoyed by the wait, try setting
+‘ebdb-try-speedups’ to non-nil.  This will disable some checks performed
+during the object creation process, which theoretically shouldn’t make a
+difference.  If something does go wrong at load-time, however, try
+setting this back to ‘nil’ first.
+
 
 File: ebdb.info,  Node: Creating Records,  Next: Record Fields,  Prev: The 
EBDB Database,  Up: Top
 
@@ -1915,6 +1922,7 @@ Index
 * d e:                                   The EBDB Database.   (line  46)
 * d m:                                   The EBDB Database.   (line  57)
 * d r:                                   The EBDB Database.   (line  67)
+* Database load times:                   The EBDB Database.   (line  83)
 * Databases:                             The EBDB Database.   (line  11)
 * Deleting fields:                       Deleting Records and Fields.
                                                               (line   6)
@@ -2093,6 +2101,7 @@ Index
 * ebdb-sources:                          The EBDB Database.   (line  11)
 * ebdb-toggle-records-format:            The Basics of ebdb-mode.
                                                               (line  61)
+* ebdb-try-speedups:                     The EBDB Database.   (line  83)
 * ebdb-use-diary:                        Diary Integration.   (line  13)
 * ebdb-user-name-address-re:             Auto-Updating Records.
                                                               (line  48)
@@ -2120,6 +2129,7 @@ Index
 * Internationalization:                  Internationalization.
                                                               (line   6)
 * Inverting searches:                    Searching.           (line  46)
+* Loading databases:                     The EBDB Database.   (line  83)
 * m:                                     The Basics of ebdb-mode.
                                                               (line  56)
 * Mail aliases:                          Mail Aliases.        (line   6)
@@ -2178,54 +2188,54 @@ Node: Migration from BBDB3026
 Node: Record Migration3201
 Node: Variables and Options3921
 Node: The EBDB Database4407
-Node: Creating Records7959
-Node: Record classes9040
-Node: Record names9385
-Node: Record Fields10060
-Node: Inserting New Fields10304
-Node: Editing Existing Fields11100
-Node: Deleting Records and Fields11700
-Node: Field Types12096
-Node: Role fields14287
-Node: Tag field15975
-Node: Mail folder field16619
-Node: MUA Interaction16947
-Node: Loading MUA Code17471
-Node: Display and Updating18180
-Node: Pop-up Buffers18946
-Node: Auto-Updating Records19784
-Node: Noticing and Automatic Rules22184
-Node: Interactive Commands23517
-Node: EBDB and MUA summary buffers25879
-Node: Sender name display26365
-Node: Summary buffer marks27592
-Node: EBDB Buffers28771
-Node: Searching29953
-Node: Changing Search Behavior31615
-Node: The Basics of ebdb-mode32862
-Node: Marking36463
-Node: Exporting/Formatting36887
-Node: Completion37836
-Node: Snarfing39034
-Node: Internationalization41035
-Node: Diary Integration43734
-Node: Mail Aliases44599
-Node: vCard Support45313
-Node: Org Integration45812
-Node: Citing Records47710
-Node: Hacking EBDB48468
-Node: Field Classes50789
-Node: Init and Delete Methods53773
-Node: The Labeled Field Class55280
-Node: The Singleton Field Class56134
-Node: Actions56572
-Node: Custom Field Searching57244
-Node: Fast Lookups60048
-Node: Formatting in the EBDB Buffer61858
-Node: Writing Internationalization Libraries63871
-Node: Writing Integration For New MUAs68224
-Node: Article snarfing71643
-Node: Index72361
+Node: Creating Records8341
+Node: Record classes9422
+Node: Record names9767
+Node: Record Fields10442
+Node: Inserting New Fields10686
+Node: Editing Existing Fields11482
+Node: Deleting Records and Fields12082
+Node: Field Types12478
+Node: Role fields14669
+Node: Tag field16357
+Node: Mail folder field17001
+Node: MUA Interaction17329
+Node: Loading MUA Code17853
+Node: Display and Updating18562
+Node: Pop-up Buffers19328
+Node: Auto-Updating Records20166
+Node: Noticing and Automatic Rules22566
+Node: Interactive Commands23899
+Node: EBDB and MUA summary buffers26261
+Node: Sender name display26747
+Node: Summary buffer marks27974
+Node: EBDB Buffers29153
+Node: Searching30335
+Node: Changing Search Behavior31997
+Node: The Basics of ebdb-mode33244
+Node: Marking36845
+Node: Exporting/Formatting37269
+Node: Completion38218
+Node: Snarfing39416
+Node: Internationalization41417
+Node: Diary Integration44116
+Node: Mail Aliases44981
+Node: vCard Support45695
+Node: Org Integration46194
+Node: Citing Records48092
+Node: Hacking EBDB48850
+Node: Field Classes51171
+Node: Init and Delete Methods54155
+Node: The Labeled Field Class55662
+Node: The Singleton Field Class56516
+Node: Actions56954
+Node: Custom Field Searching57626
+Node: Fast Lookups60430
+Node: Formatting in the EBDB Buffer62240
+Node: Writing Internationalization Libraries64253
+Node: Writing Integration For New MUAs68606
+Node: Article snarfing72025
+Node: Index72743
 
 End Tag Table
 
diff --git a/ebdb.org b/ebdb.org
index 8e7454e..7b62239 100644
--- a/ebdb.org
+++ b/ebdb.org
@@ -168,6 +168,16 @@ Typically, databases are saved using the {{{kbd(s)}}} 
binding in
 ~ebdb-mode~ buffers, which runs ~ebdb-save~.  By default, EBDB also
 installs ~ebdb-save~ as part of the ~kill-emacs-hook~.  Set
 ~ebdb-install-save-hook~ to nil to prevent this.
+
+#+CINDEX: Loading databases
+#+CINDEX: Database load times
+#+VINDEX: ebdb-try-speedups
+Loading and initializing the EBDB can be slow for large databases.  If
+you find yourself annoyed by the wait, try setting ~ebdb-try-speedups~
+to non-nil.  This will disable some checks performed during the object
+creation process, which theoretically shouldn't make a difference.  If
+something does go wrong at load-time, however, try setting this back
+to ~nil~ first.
 * Creating Records
 :PROPERTIES:
 :ID:       692cde31-73be-4faf-b436-7eae8a5d02d1
diff --git a/ebdb.texi b/ebdb.texi
index 849bed5..a28fca6 100644
--- a/ebdb.texi
+++ b/ebdb.texi
@@ -313,6 +313,16 @@ Typically, databases are saved using the @kbd{s} binding in
 installs @code{ebdb-save} as part of the @code{kill-emacs-hook}.  Set
 @code{ebdb-install-save-hook} to nil to prevent this.
 
address@hidden Loading databases
address@hidden Database load times
address@hidden ebdb-try-speedups
+Loading and initializing the EBDB can be slow for large databases.  If
+you find yourself annoyed by the wait, try setting @code{ebdb-try-speedups}
+to non-nil.  This will disable some checks performed during the object
+creation process, which theoretically shouldn't make a difference.  If
+something does go wrong at load-time, however, try setting this back
+to @code{nil} first.
+
 @node Creating Records
 @chapter Creating Records
 



reply via email to

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