all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Byte Compile Question
@ 2012-07-27 14:44 Perry Smith
  2012-07-27 15:12 ` Christopher Schmidt
  0 siblings, 1 reply; 5+ messages in thread
From: Perry Smith @ 2012-07-27 14:44 UTC (permalink / raw)
  To: Emacs help

Hi,

I have the belief that byte compiling only helps with loading files and that once they are loaded, the code will execute at the same speed.

Is that correct?

Byte compiling all my personal files is a bit awkward for a couple of reasons.  I considering not doing it any more but wanted to know all the tradeoffs.

If you can, please CC me on your replies.

Thank you,
Perry Smith




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

* Re: Byte Compile Question
  2012-07-27 14:44 Perry Smith
@ 2012-07-27 15:12 ` Christopher Schmidt
  2012-07-27 15:18   ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Christopher Schmidt @ 2012-07-27 15:12 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: Perry Smith

[-- Attachment #1: Type: text/plain, Size: 637 bytes --]

Perry Smith <pedzsan@gmail.com> writes:
> I have the belief that byte compiling only helps with loading files
> and that once they are loaded, the code will execute at the same
> speed.
>
> Is that correct?

No.  Check (info "(elisp)Byte Compilation").

> Byte compiling all my personal files is a bit awkward for a couple of
> reasons.  I considering not doing it any more but wanted to know all
> the tradeoffs

Give it a try.  Your code executes faster and the compiler warnings are
useful in most cases.

You can implement automatic byte compilation by customising
load-source-file-function.  Here is my auto-compile implementation.

[-- Attachment #2: auto-compile.el --]
[-- Type: application/emacs-lisp, Size: 2983 bytes --]

[-- Attachment #3: Type: text/plain, Size: 21 bytes --]


        Christopher

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

* RE: Byte Compile Question
  2012-07-27 15:12 ` Christopher Schmidt
@ 2012-07-27 15:18   ` Drew Adams
  0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2012-07-27 15:18 UTC (permalink / raw)
  To: 'Christopher Schmidt', help-gnu-emacs; +Cc: 'Perry Smith'

> You can implement automatic byte compilation by customising
> load-source-file-function.  Here is my auto-compile implementation.

See also command `byte-recompile-directory'.




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

* Re: Byte Compile Question
       [not found] <mailman.5757.1343400279.855.help-gnu-emacs@gnu.org>
@ 2012-07-27 16:04 ` Pascal J. Bourguignon
  2012-07-31 12:52 ` Xah Lee
  1 sibling, 0 replies; 5+ messages in thread
From: Pascal J. Bourguignon @ 2012-07-27 16:04 UTC (permalink / raw)
  To: help-gnu-emacs

Perry Smith <pedzsan@gmail.com> writes:

> Hi,
>
> I have the belief that byte compiling only helps with loading files
> and that once they are loaded, the code will execute at the same
> speed.
>
> Is that correct?

No.  It will make your code run faster.


> Byte compiling all my personal files is a bit awkward for a couple of
> reasons.  I considering not doing it any more but wanted to know all
> the tradeoffs.

Indeed.  One problem with that is usually those personal files change
often, so you would have to recompile them often.  But you can
automatize this recompiling so it may not be a big problem.
Personnally, I have a fast enough computer, so I don't bother with
compiling my files.



-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.


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

* Re: Byte Compile Question
       [not found] <mailman.5757.1343400279.855.help-gnu-emacs@gnu.org>
  2012-07-27 16:04 ` Byte Compile Question Pascal J. Bourguignon
@ 2012-07-31 12:52 ` Xah Lee
  1 sibling, 0 replies; 5+ messages in thread
From: Xah Lee @ 2012-07-31 12:52 UTC (permalink / raw)
  To: help-gnu-emacs

byte-compile elisp buffer on save, only if a byte-compiled file
exists.

(defun byte-compile-current-buffer ()
  "`byte-compile' current buffer if it's emacs-lisp-mode and compiled
file exists."
  (interactive)
  (when (and (eq major-mode 'emacs-lisp-mode)
             (file-exists-p (byte-compile-dest-file buffer-file-
name)))
    (byte-compile-file buffer-file-name)))

(add-hook 'after-save-hook 'byte-compile-current-buffer)

code part from Adolfo Benedetti.

some other tips:

〈Organize Your “dot emacs” Init File in 5 Minutes〉
http://ergoemacs.org/emacs/organize_your_dot_emacs.html

btw, there's lots alternatives on emacswiki.

 Xah

On Jul 27, 7:44 am, Perry Smith <pedz...@gmail.com> wrote:
> Hi,
>
> I have the belief that byte compiling only helps with loading files and that once they are loaded, the code will execute at the same speed.
>
> Is that correct?
>
> Byte compiling all my personal files is a bit awkward for a couple of reasons.  I considering not doing it any more but wanted to know all the tradeoffs.
>
> If you can, please CC me on your replies.
>
> Thank you,
> Perry Smith


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

end of thread, other threads:[~2012-07-31 12:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.5757.1343400279.855.help-gnu-emacs@gnu.org>
2012-07-27 16:04 ` Byte Compile Question Pascal J. Bourguignon
2012-07-31 12:52 ` Xah Lee
2012-07-27 14:44 Perry Smith
2012-07-27 15:12 ` Christopher Schmidt
2012-07-27 15:18   ` Drew Adams

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.