aboutsummaryrefslogtreecommitdiff
path: root/emms-source-file.el
diff options
context:
space:
mode:
authormlang <mlang>2007-02-21 14:05:00 +0000
committermlang <mwolson@gnu.org>2007-02-21 14:05:00 +0000
commit0a2a9b02e30a9d9755102a07a41cac8bddccdab9 (patch)
treef22332bbd4182f30f0a729cf5b0edc5e29db4d45 /emms-source-file.el
parentc042491950f6b57ff1c14d6bfd9d4f01a72d5d4a (diff)
Speed up emms-play-directory-tree by about factor 10
Most of the speedup comes from using nconc in later-do instead of append (and therefore, not excessively copying lists). I see a factor of 10 speedup when generating the playlist for 37000 audio files. darcs-hash:20070221140553-08870-162cb94182e5e4947a0972a67b9229db8899e7cd.gz
Diffstat (limited to 'emms-source-file.el')
-rw-r--r--emms-source-file.el16
1 files changed, 9 insertions, 7 deletions
diff --git a/emms-source-file.el b/emms-source-file.el
index 5384f4a..79bbfc7 100644
--- a/emms-source-file.el
+++ b/emms-source-file.el
@@ -135,13 +135,15 @@ value of `emms-source-file-default-directory'."
emms-source-file-default-directory
emms-source-file-default-directory
t)))
- (mapc (lambda (file)
- (unless (let ((case-fold-search nil))
- (string-match emms-source-file-exclude-regexp file))
- (emms-playlist-insert-track
- (emms-track 'file file))))
- (emms-source-file-directory-tree (expand-file-name dir)
- (emms-source-file-regex))))
+ (let ((files (emms-source-file-directory-tree (expand-file-name dir)
+ (emms-source-file-regex)))
+ (case-fold-search nil))
+ (emms-playlist-ensure-playlist-buffer)
+ (mapc (lambda (file)
+ (unless (string-match emms-source-file-exclude-regexp file)
+ (funcall emms-playlist-insert-track-function
+ (emms-track 'file file))))
+ files)))
;;;###autoload (autoload 'emms-play-find "emms-source-file" nil t)
;;;###autoload (autoload 'emms-add-find "emms-source-file" nil t)