unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Keith David Bershatsky <esq@lawlist.com>
To: Alex Gramiak <agrambot@gmail.com>
Cc: eliz@gnu.org, dancol@dancol.org, emacs-devel@gnu.org
Subject: Re: NS port: How to debug excessive garbage collection?
Date: Sun, 14 Apr 2019 19:55:46 -0700	[thread overview]
Message-ID: <m25zrgq8nh.wl%esq@lawlist.com> (raw)

Thank you, Alex ... I like the idea of not using a Lisp_Object to store the various window caches of fake cursors, as this would entirely eliminate the garbage collection issues.  Inasmuch as this would be my first usage of an array in the world of programming, some guidance regarding the best way to initialize the array (window cache) would be greatly appreciated.

The foreground and background colors of each fake cursor are sets of three doubles (red/green/blue).  They do not necessarily need to be stored as a set of three, and could be broken up into separate columns within the array if that is more prudent.  active_p is a boolean type, but could be expressed as an int instead.

I saw a few online examples that initialize an array as int _or_ double, but not both simultaneously.  So, I thought to myself that they could all be doubles if need be ....

I saw three types of arrays:  an array matching an exact size known in advance; an array that is defined with a specified MAX_ROW / MAX_COL (some rows/columns may never be used); and, an array using dynamic allocation with malloc, realloc and free.

Each window cache should be able to handle up to 250 fake cursors.  The present design uses up to four (4) different window caches for each window where fake cursors are active.  Each fake cursor would need entries in the cache of either 14 elements or 18 elements, depending upon whether the foreground/background colors are grouped or broken up.

How do you recommend that the array for each window cache be initialized?

1.  int x
2.  int fx
3.  int y
4.  int fy
5.  int hpos
6.  int vpos
7.  int wd
8.  int h
9.  int cursor_type
10. int cursor_width
11. double foreground_red
12. double foreground_green
13. double foreground_blue
14. double background_red
15. double background_green
16. double background_blue
17. bool active_p
18. int glyph_flavor

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

> Date: [04-14-2019 16:31:16] <14 Apr 2019 17:31:16 -0600>
> From: Alex Gramiak <agrambot@gmail.com>
> To: Keith David Bershatsky <esq@lawlist.com>
> Cc: eliz@gnu.org, dancol@dancol.org, emacs-devel@gnu.org
> Subject: Re: NS port: How to debug excessive garbage collection?
> 
> * * *
> 
> Looking at your actual implementation though, I don't see a reason for your cache to be a Lisp_Object at all; am I missing something?  It seems that you could just use a C array of length 14.  Not making any cons cells at all is the best approach if you can do so.
> 
> * * *



             reply	other threads:[~2019-04-15  2:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-15  2:55 Keith David Bershatsky [this message]
2019-04-15  3:44 ` NS port: How to debug excessive garbage collection? Alex Gramiak
  -- 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-14 19:46 Keith David Bershatsky
2019-04-14 23:31 ` Alex Gramiak
2019-04-14  7:41 Keith David Bershatsky
2019-04-13 18:07 Keith David Bershatsky
2019-04-13 21:41 ` Alex Gramiak
2019-04-14  3:47 ` Daniel Colascione
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=m25zrgq8nh.wl%esq@lawlist.com \
    --to=esq@lawlist.com \
    --cc=agrambot@gmail.com \
    --cc=dancol@dancol.org \
    --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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).