emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: org-agenda search is slow on Windows 10 [9.4.4 (release_9.4.4 @ c:/Program Files/Emacs/x86_64/share/emacs/27.2/lisp/org/)]
@ 2022-03-02 21:19 Robert Mastragostino
  2022-03-12 13:32 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Mastragostino @ 2022-03-02 21:19 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org


[-- Attachment #1.1: Type: text/plain, Size: 10187 bytes --]

Hello,

Org-agenda search is being unreasonably slow, taking several seconds to search through ~100 small files (a simple python program is practically instantaneous). I'm not familiar with proper emacs profiling but pausing in the middle of the search essentially always gives the stack trace below, where some recursion attempting to figure out file names is waiting on w32-long-file-name.

I've also attached my init.el, though as far as I can tell this isn't interference from another package.

Robert

Emacs  : GNU Emacs 27.2 (build 1, x86_64-w64-mingw32)
 of 2021-03-26
Package: Org mode version 9.4.4 (release_9.4.4 @ c:/Program Files/Emacs/x86_64/share/emacs/27.2/lisp/org/)

------
stack trace:

Debugger entered--Lisp error: (quit)
  w32-long-file-name("c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam")
  file-truename("c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam" (99) (nil))
  file-truename("c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2...")
  file-equal-p("c:/Users/rmast/AppData/Roaming/.emacs.d/orgfiles/t..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2...")
  #f(compiled-function (a b) #<bytecode 0x29d969d>)("c:/Users/rmast/AppData/Roaming/.emacs.d/orgfiles/t..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2...")
  cl--position("c:/Users/rmast/AppData/Roaming/.emacs.d/orgfiles/t..." ("c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." ...) 0 125)
  cl--delete-duplicates(("c:/Users/rmast/AppData/Roaming/.emacs.d/orgfiles/B..." "c:/Users/rmast/AppData/Roaming/.emacs.d/orgfiles/n..." "c:/Users/rmast/AppData/Roaming/.emacs.d/orgfiles/t..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." ...) (:test #f(compiled-function (a b) #<bytecode 0x29d969d>)) t)
  cl-remove-duplicates(("c:/Users/rmast/AppData/Roaming/.emacs.d/orgfiles/B..." "c:/Users/rmast/AppData/Roaming/.emacs.d/orgfiles/n..." "c:/Users/rmast/AppData/Roaming/.emacs.d/orgfiles/t..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." "c:/Users/rmast/AppData/Roaming/.emacs.d/org-roam/2..." ...) :test #f(compiled-function (a b) #<bytecode 0x29d969d>))
  org-search-view(nil)
  funcall-interactively(org-search-view nil)
  call-interactively(org-search-view)
  org-agenda(nil)
  funcall-interactively(org-agenda nil)
  call-interactively(org-agenda nil nil)
  command-execute(org-agenda)

[-- Attachment #1.2: Type: text/html, Size: 13882 bytes --]

[-- Attachment #2: init.el --]
[-- Type: application/octet-stream, Size: 4178 bytes --]

;(setq package-gnupghome-dir "/c/Users/rmast/AppData/Roaming/.emacs.d/elpa/gnupg")
(require 'package)
(package-initialize)
(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
(package-initialize)

(auto-save-visited-mode 1)

;;search and info
;; Ivy,Counsel, & Swiper
;; Enable Ivy mode in general
(ivy-mode 1)
(setq ivy-use-virtual-buffers t)
(setq enable-recursive-minibuffers t)
(setq ivy-re-builders-alist
      '((swiper . regexp-quote)
        (t      . ivy--regex-fuzzy)))

;; Add Counsel and Swiper search functions
(global-set-key (kbd "C-c f r") #'counsel-recentf)
(global-set-key (kbd "C-c C-s") #'swiper)

;; Replace default "M-x" and "C-x C-f" with Counsel version
(global-set-key (kbd "M-x") #'counsel-M-x)
(global-set-key (kbd "C-x C-f") #'counsel-find-file)

;; Optionally, you can replace these default functions with Counsel version, too
(global-set-key (kbd "C-h f") 'counsel-describe-function)
(global-set-key (kbd "C-h v") 'counsel-describe-variable)

(require 'yasnippet)
(yas-global-mode 1)

;;org-mode


(global-set-key (kbd "C-c a") #'org-agenda)
(setq org-agenda-files (list "~/.emacs.d/orgfiles/"))
(setq org-agenda-files (list "~/.emacs.d/org-roam/*.org"))
(setq org-agenda-inhibit-startup t)
(add-hook 'org-mode-hook (lambda () (org-superstar-mode 1)))
(setq org-hide-leading-stars t)

(setq org-todo-keywords '((sequence "TODO" "OPEN" "|" "DONE")))

 (setq org-directory "~/.emacs.d/orgfiles")
 (setq org-default-notes-file (concat org-directory "/todos.org"))

(setq org-capture-templates
      '(("t" "TODO" entry (file+headline org-default-notes-file "Tasks:")
	 "* TODO %?\n %i\n %a")
	("r" "TO READ" entry (file+headline org-default-notes-file "To Read:")
	 "* TODO : [[%^{PROMPT}][%^{PROMPT}]] :document: \n  %?")))

; customizing org mode

  (use-package org-download
    :after org
    :defer nil
    :custom
    (org-download-method 'directory)
    (org-download-image-dir "images")
    (org-download-heading-lvl nil)
    
    (org-download-timestamp "%Y%m%d-%H%M%S_")
    (org-image-actual-width 300)
    (org-download-screenshot-method "magick clipboard:*.bmp %s")
    :bind
    ("C-M-y" . org-download-screenshot)
    :config
    (require 'org-download))

;;org-roam
(add-to-list 'exec-path' "C:\\Program Files (x86)\\SQLite\\sqlite-tools-win32-x86-3350400")
(setq org-roam-directory "~\\.emacs.d\\org-roam")
;;; Tell Emacs to start org-roam-mode when Emacs starts
(add-hook 'after-init-hook 'org-roam-mode)

;;; Define key bindings for Org-roam
(global-set-key (kbd "C-c n r") #'org-roam-buffer-toggle-display)
(global-set-key (kbd "C-c n i") #'org-roam-insert)
(global-set-key (kbd "C-c n /") #'org-roam-find-file)
(global-set-key (kbd "C-c n b") #'org-roam-switch-to-buffer)
(global-set-key (kbd "C-c n d") #'org-roam-find-directory)

;;; Recommendation for Windows users for performance
;;; https://github.com/org-roam/org-roam/issues/1289#issuecomment-744046148
(setq org-roam-db-update-method 'immediate)

;Let's also assign C-z to undo here
(global-set-key (kbd "C-z") 'undo) ;Emacs default is bound to hide Emacs.


;;LOOKS OF UI
;; Olivetti
;; Look & Feel for long-form writing
(require 'olivetti)
;; Set the body text width
(setq olivetti-body-width 80)

;; Enable Olivetti for text-related mode such as Org Mode
(add-hook 'text-mode-hook 'olivetti-mode)
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(cua-mode t nil (cua-base))
 '(org-agenda-files
   '("C:\\Users\\rmast\\AppData\\Roaming\\.emacs.d\\orgfiles" "C:\\Users\\rmast\\AppData\\Roaming\\.emacs.d\\org-roam")))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug: org-agenda search is slow on Windows 10 [9.4.4 (release_9.4.4 @ c:/Program Files/Emacs/x86_64/share/emacs/27.2/lisp/org/)]
  2022-03-02 21:19 Bug: org-agenda search is slow on Windows 10 [9.4.4 (release_9.4.4 @ c:/Program Files/Emacs/x86_64/share/emacs/27.2/lisp/org/)] Robert Mastragostino
@ 2022-03-12 13:32 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2022-03-12 13:32 UTC (permalink / raw)
  To: Robert Mastragostino; +Cc: emacs-orgmode@gnu.org

Robert Mastragostino <r.mastragostino@hotmail.com> writes:

> Hello,
>
> Org-agenda search is being unreasonably slow, taking several seconds to search through ~100 small files (a simple python program is practically instantaneous). I'm not familiar with proper emacs profiling but pausing in the middle of the search essentially always gives the stack trace below, where some recursion attempting to figure out file names is waiting on w32-long-file-name.
>
> I've also attached my init.el, though as far as I can tell this isn't interference from another package.

We have significantly improved Org mode performance on development
(main) branch. AFAIU, 100 small files should not be an issue on latest
Org.

Best,
Ihor


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-12 13:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-02 21:19 Bug: org-agenda search is slow on Windows 10 [9.4.4 (release_9.4.4 @ c:/Program Files/Emacs/x86_64/share/emacs/27.2/lisp/org/)] Robert Mastragostino
2022-03-12 13:32 ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).