all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: taylanbayirli@gmail.com (Taylan Ulrich Bayırlı/Kammer)
To: Alan Mackenzie <acm@muc.de>
Cc: Xue Fuqiao <xfq.free@gmail.com>,
	Christopher Allan Webber <cwebber@dustycloud.org>,
	Daniel Colascione <dancol@dancol.org>,
	bruce.connor.am@gmail.com, emacs-devel <emacs-devel@gnu.org>
Subject: Re: In support of guile-emacs
Date: Tue, 20 Oct 2015 22:09:46 +0200	[thread overview]
Message-ID: <87bnbtgv3p.fsf@T420.taylan> (raw)
In-Reply-To: <20151020095332.GA1781@acm.fritz.box> (Alan Mackenzie's message of "Tue, 20 Oct 2015 09:53:32 +0000")

Alan Mackenzie <acm@muc.de> writes:

> [...]
>
>> (let loop ((i 0) (s 0))
>>   (if (<= i 10000000)
>>       (loop (+ i 1) (+ s i))
>>       (format #t "~s" s)))
>
>> Takes about 0.50s.
>
> So, we're talking about a speed up of around 13%/25% on a simple loop
> test, depending on whether or not an idiomatic Scheme formulation is
> used.  Given that Guile compiled elisp wouldn't be optimised in this way,
> it would guess that the 13% is nearer the mark.  But it would take a few
> real life tests to measure this better.

Indeed, I don't think any conclusions should be drawn from this.

>> BTW here's a timing function that automatically byte-compiles the
>> argument (side-effectfully if a symbol):
>
>> (defun time (function)
>>   "Return execution time of calling FUNCTION in seconds as a
>> float.  FUNCTION is byte-compiled automatically."
>>   (setq function (byte-compile function))
>>   (let ((start (current-time)))
>>     (funcall function)
>>     (let ((end (current-time)))
>>       (let ((time (time-subtract end start)))
>>         (+ (* (nth 0 time) (expt 2 16))
>>            (nth 1 time)
>>            (/ (nth 2 time) 1000000.0))))))
>
> Hint: there's a function `float-time' which does the job adequately, and
> is easier to manipulate.  For comparison, here's my `time-it' macro
> (which doesn't itself do byte compilation):
>
> (defmacro time-it (&rest forms)
>   "Time the running of a sequence of forms using `float-time'.
> Call like this: \"M-: (time-it (foo ...) (bar ...) ...)\"."
>   `(let ((start (float-time)))
>     ,@forms
>     (- (float-time) start)))
>
> [ .... ]

Oh neat.  I forgot we had float-time.

>> > If Guile Emacs is advanced enough, timing the fontification of a file
>> > (say, ..../src/xdisp.c in our repository) would be a very meaningful
>> > timing.
>
>> I'm guessing that Guile Emacs isn't ready for that yet but, how can one
>> time that?
>
> Start by unfontifying the entire file, then scroll through it, fontifying
> a screen at a time.  (sit-for 0) is used to ensure fontification at each
> stage.  So something like this (untested) would do the job:
>
> (defun fully-fontify ()
>   (beginning-of-buffer)
>   (font-lock-mode 0)
>   (font-lock-mode 1)
>   (condition-case nil
>     (while t
>       (sit-for 0)
>       (scroll-up))))
>
> The `condition-case' catches the error thrown when `scroll-up' reaches
> the end of the buffer.

I had to add the handler `(error nil)' to that, then it worked.

GuileEmacs would first refuse to open xdisp.c, which I thought was a new
feature, but ultimately it opened it. :-)

This is comparing release Emacs to (pre?) alpha GuileEmacs so it
shouldn't come as a surprise (and I didn't care to normalize for X
toolkit) but here goes:

 36.5 seconds with stock Emacs 24.5.1 with no X toolkit from Guix
169.6 seconds with Guile Emacs master branch with GTK from Guix

I think the main problem is a bug that leaks tons of memory and thus
leads to long GC pauses, because GuileEmacs would pause for long times
and reached 700 MB residential memory after it was done.


Since I seem incapable of cooperating with several people on emacs-devel
on typical development topics (see recent drama ... or don't), I guess I
could just devote all my Emacs-related efforts to Guile Emacs.  I still
have a bunch of non-Emacs projects running in parallel though, and I
don't know if I have the Guile *or* Emacs related skills to hack on
this, so don't keep your hopes high.

Taylan



  reply	other threads:[~2015-10-20 20:09 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-18 20:48 In support of guile-emacs Christopher Allan Webber
2015-10-18 23:12 ` Artur Malabarba
2015-10-19  1:07   ` Xue Fuqiao
2015-10-19 10:24     ` Alan Mackenzie
2015-10-19 10:27       ` David Kastrup
2015-10-19 14:14       ` Daniel Colascione
2015-10-19 14:35         ` Alan Mackenzie
2015-10-19 16:56           ` Taylan Ulrich Bayırlı/Kammer
2015-10-19 17:19             ` Alan Mackenzie
2015-10-19 18:50               ` Taylan Ulrich Bayırlı/Kammer
2015-10-19 19:03                 ` Dmitry Gutov
2015-10-19 19:49                   ` Taylan Ulrich Bayırlı/Kammer
2015-10-19 20:12                 ` Alan Mackenzie
2015-10-19 21:01                   ` Taylan Ulrich Bayırlı/Kammer
2015-10-20  9:53                     ` Alan Mackenzie
2015-10-20 20:09                       ` Taylan Ulrich Bayırlı/Kammer [this message]
2015-10-20 23:46                         ` John Wiegley
2015-10-21 12:54                         ` Taylan Ulrich Bayırlı/Kammer
2015-10-21 13:13                           ` Alan Mackenzie
2015-10-20  6:00                   ` David Kastrup
2015-10-19 14:50         ` David Kastrup
2015-10-19  8:22 ` Tom
2015-10-19  8:38   ` Andreas Schwab
2015-10-19  8:54     ` Tom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bnbtgv3p.fsf@T420.taylan \
    --to=taylanbayirli@gmail.com \
    --cc=acm@muc.de \
    --cc=bruce.connor.am@gmail.com \
    --cc=cwebber@dustycloud.org \
    --cc=dancol@dancol.org \
    --cc=emacs-devel@gnu.org \
    --cc=xfq.free@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.