all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Keith David Bershatsky <esq@lawlist.com>
To: Alex Gramiak <agrambot@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: NS port:  How to debug excessive garbage collection?
Date: Sat, 13 Apr 2019 11:07:55 -0700	[thread overview]
Message-ID: <m24l71hj7o.wl%esq@lawlist.com> (raw)

Thank you, Alex, for helping to diagnose the issue of excessive garbage collection.  I observe the issue when building Emacs on an OSX machine using the --with-ns flag.  The issue may also occur on the w32 and X11 builds of Emacs, but it is not noticeable to my naked eye.  The NS build, on the other hand, permits me to see an appreciable pause for garbage collection every few keystrokes.  The garbage collection tests with *_consed that I performed today were on the NS port of Emacs.

The usage of Ftruncate in the 04/08/2019 proof concept patch of fake cursors occurs only in w32term.c and xterm.c.

My general understanding is as follows:

1.  Emacs uses nsterm.m/h when building on an OSX machine and the --with-ns flag.

2.  Emacs uses xterm.c when building on an OSX machine that has X11 installed and the following flags are used:  --with-x (yes) and --with-ns (no).

3.  Emacs uses w32term.c when building on a Windows machine.

I would be pleased to remove Ftruncate and replace it with roundf.  Thank you for the suggestion.  The development of the fake cursors feature has been a work in progress for a little over 3 years now ... learning some C coding along the way.  I have seen roundf in a few internet examples over the years, and have a vague recollection of trying to use it somewhere -- however, I cannot remember in what context.

Perhaps there is a similar mistake I have made that would affect the NS build of Emacs, or perhaps would affect all of the builds (NS/w32/X11).  It is interesting that excessive garbage collection occurs even with the fake cursors feature turned _off_, and it gets much worse when that feature is turned _on_.

Keith

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

> Date: [04-13-2019 10:02:07] <13 Apr 2019 11:02:07 -0600>
> From: Alex Gramiak <agrambot@gmail.com>
> To: Keith David Bershatsky <esq@lawlist.com>
> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
> Subject: Re: NS port:  How to debug excessive garbage collection?
> 
> Keith David Bershatsky <esq@lawlist.com> writes:
> 
> > ;;; begin STOCK / UNMODIFIED
> > [...]
> > ((cons_cells_consed 2455285)
> >  (symbols_consed 16084)
> >  (strings_consed 104220)
> >  (string_chars_consed 2152636)
> >  (vector_cells_consed 6884284)
> >  (floats_consed 572)
> >  (intervals_consed 112))
> >
> >
> > ;;; end STOCK UNMODIFIED
> >
> > ============================
> >
> > ;;; begin MODIFIED -- CROSSHAIRS "OFF"
> 
> > [...]
> > ((cons_cells_consed 2408250)
> >  (symbols_consed 16120)
> >  (strings_consed 112081)
> >  (string_chars_consed 2208228)
> >  (vector_cells_consed 6903029)
> >  (floats_consed 23104)
> >  (intervals_consed 112))
> >
> > ;;; end MODIFIED -- CROSSHAIRS "OFF"
> >
> > ============================
> >
> > ;;; begin MODIFIED -- CROSSHAIRS "ON"
> >
> > [...]
> > ((cons_cells_consed 2471395)
> >  (symbols_consed 16122)
> >  (strings_consed 111473)
> >  (string_chars_consed 2209234)
> >  (vector_cells_consed 6898322)
> >  (floats_consed 19817)
> >  (intervals_consed 112))
> 
> Your floats look out of control. I checked your latest diff, and found
> this:
> 
> +  int int_red = XFIXNUM (Ftruncate (make_float (term_red), Qnil));
> +  int int_green = XFIXNUM (Ftruncate (make_float (term_green), Qnil));;
> +  int int_blue = XFIXNUM (Ftruncate (make_float (term_blue), Qnil));;
> 
> Why do you make a Lisp float just to truncate it? Can you run your test
> again using one of the following?
> 
> https://en.cppreference.com/w/c/numeric/math/round



             reply	other threads:[~2019-04-13 18:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-13 18:07 Keith David Bershatsky [this message]
2019-04-13 21:41 ` NS port: How to debug excessive garbage collection? Alex Gramiak
2019-04-14  3:47 ` Daniel Colascione
  -- strict thread matches above, loose matches on Subject: below --
2019-04-16  5:51 Keith David Bershatsky
2019-04-16  2:57 Keith David Bershatsky
2019-04-16  5:26 ` Alex Gramiak
2019-04-15  5:19 Keith David Bershatsky
2019-04-15  2:55 Keith David Bershatsky
2019-04-15  3:44 ` Alex Gramiak
2019-04-14 19:46 Keith David Bershatsky
2019-04-14 23:31 ` Alex Gramiak
2019-04-14  7:41 Keith David Bershatsky
2019-04-13 16:31 Keith David Bershatsky
2019-04-13 17:02 ` Alex Gramiak
2019-04-13  5:55 Keith David Bershatsky
2019-04-13  6:48 ` Eli Zaretskii
2019-04-11 23:04 Keith David Bershatsky
2019-04-12  9:30 ` Eli Zaretskii
2019-04-11  3:27 Keith David Bershatsky
2019-04-11 14:14 ` Eli Zaretskii

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=m24l71hj7o.wl%esq@lawlist.com \
    --to=esq@lawlist.com \
    --cc=agrambot@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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.