1

I am trying to have configuration byte-compiled to improve performances further.

The original code works with no issue. However, adding the optional compile argument:

(require 'ob-tangle)
(org-babel-load-file (expand-file-name "dotemacs.org" user-emacs-directory) t)

Yields the following:

dotemacs.el:79:17:Warning: reference to free variable `package-archives'
dotemacs.el:79:17:Warning: assignment to free variable `package-archives'
dotemacs.el:91:4:Error: Cannot open load file: no such file or directory, use-package

Here is my init.el. And here is the part that breaks in my dotemacs.org.

  • You probably need a (package-initialize) before (org-babel-load-file ...) – Ury Marshak Jun 9 '16 at 11:02
  • Although requiring use-package before org-babel-load-file did fix my issue. I haven't noticed any improvement in performance. Also, it compiles everytime, even when files didn't change. – Mathieu Marques Jun 10 '16 at 15:22
  • Based on my own experience with keeping configuration in .org files, you won't notice any performance gain after byte-compiling your init file because it's insignificant compared to (1) tangling the org-file and (2) loading all the packages. To address the issue (2) use the :defer t option of use-package where appropriate. To address (1) change your code to check timestamps on the .org and the .el files and tangle (run org-babel-load-file) only when .org is newer. – Ury Marshak Jun 11 '16 at 11:26
  • A little misunderstanding here. When I say performance, I mean runtime performance, not initialization time. – Mathieu Marques Jun 11 '16 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.