-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[EMAIL PROTECTED] (Kevin A. Burton) writes:

> OK...
> 
> I usually keep my Emacs running about ~300 buffers.  It just ends up that way.
> 
> The only problem is that jde-load-project-file starts to take a LONG time.  In
> the range of about 10-15 seconds.  When you are trying to get work done this is
> tough to deal with.
> 
> Where is the bottleneck?  Even if I comment out my prj.el file it still is
> pretty bad. :(

OK... thinking out loud I guess.

The bottleneck (at least on my machine) was 'funcall'.  Is it needed... don't
think so.

I guess the indirection of 300 items was slowing down emacs...  anyway here are
the two function defs... the second is about 10000% faster (at least on my
machine).

the diff is just (funcall set symbol val-to-set)) to (set symbol val-to-set))

Thanks!

(defun jde-set-variables-init-value (&optional msg)
  "Set each JDE variable to the value it has at Emacs startup."
  (interactive)
  (if (or (interactive-p) msg)
      (message "Setting JDE variables to startup values..."))
  (mapcar 
   (lambda (symbol) 
     (let ((val-to-set (eval (car (or (get symbol 'saved-value)
                                      (get symbol 'standard-value)))))
           (set (or (get symbol 'custom-set) 'set-default)))
       (if (or (get symbol 'customized-value)
               (get symbol 'jde-project))
           (funcall set symbol val-to-set))
       (put symbol 'customized-value nil)
       (put symbol 'jde-project nil)
       (jde-put-project symbol "default" val-to-set)))
   (jde-symbol-list)))

(defun jde-set-variables-init-value (&optional msg)
  "Set each JDE variable to the value it has at Emacs startup."
  (interactive)
  (if (or (interactive-p) msg)
      (message "Setting JDE variables to startup values..."))
  (mapcar 
   (lambda (symbol) 
     (let ((val-to-set (eval (car (or (get symbol 'saved-value)
                                      (get symbol 'standard-value)))))
           (set (or (get symbol 'custom-set) 'set-default)))
       (if (or (get symbol 'customized-value)
               (get symbol 'jde-project))
           (set symbol val-to-set))
       (put symbol 'customized-value nil)
       (put symbol 'jde-project nil)
       (jde-put-project symbol "default" val-to-set)))
   (jde-symbol-list)))

- -- 
Kevin A. Burton ( [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] )
             Location - San Francisco, CA, Cell - 415.595.9965
        Jabber - [EMAIL PROTECTED],  Web - http://relativity.yi.org/

Not only in computer science, but also across all scientific fields, skeptical
analysis of technical claims made by others, and the presentation of detailed
evidence to support such analysis, is the heart of the scientific method.
    - Princeton University Professor Edward Felten on the DMCA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Get my public key at: http://relativity.yi.org/pgpkey.txt

iD8DBQE8kTetAwM6xb2dfE0RAvZ6AKCUwUNH+uAwKMYO3Vf48hWKOpxwmQCgtgDs
S3ryLRzVJkTaCdA1mEe9k/s=
=93nn
-----END PGP SIGNATURE-----

Reply via email to