From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.devel Subject: Re: NS port: How to debug excessive garbage collection? Date: Sun, 14 Apr 2019 19:55:46 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="142571"; mail-complaints-to="usenet@blaine.gmane.org" Cc: eliz@gnu.org, dancol@dancol.org, emacs-devel@gnu.org To: Alex Gramiak Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 15 04:56:28 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hFrnI-000axj-AY for ged-emacs-devel@m.gmane.org; Mon, 15 Apr 2019 04:56:28 +0200 Original-Received: from localhost ([127.0.0.1]:43747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFrnG-0007Zi-Ni for ged-emacs-devel@m.gmane.org; Sun, 14 Apr 2019 22:56:26 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFrmh-0007Zd-1U for emacs-devel@gnu.org; Sun, 14 Apr 2019 22:55:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hFrmf-0003ji-Rr for emacs-devel@gnu.org; Sun, 14 Apr 2019 22:55:50 -0400 Original-Received: from gateway24.websitewelcome.com ([192.185.51.196]:29428) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hFrmf-0003jC-DF for emacs-devel@gnu.org; Sun, 14 Apr 2019 22:55:49 -0400 Original-Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 45DF22872D for ; Sun, 14 Apr 2019 21:55:48 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id FrmdhYYfMYTGMFrmehgNls; Sun, 14 Apr 2019 21:55:48 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=4OMLzqLikrhNtvLIDLDvFgfTs6s0B22pt2o0e41x6Q4=; b=c8pSfXvV14kZvZWEbtNoUfU8x6 2mghgzwHlHC7GCaYoTf0dt6KQPhGZe+SP2tjfuhknKKFOMMhrQeWc4rPpI0MSX28uag5KgjmKiMEa 9q0aSBfDC5hqBM3e3c2bExD29ew3mP1/JRO4HueFaMFn9m2t7GveSzKEE61DVC35S0ixeOfrs3Y4c DBebxRYb6/nbWF9ugE2Dnjevw0NOS50p+YPqR8lSM2UUOblBHgtM/eMrFD3tSn5IRUhRRusLim2aa Y03RbsjUtvmMJ+/JXXarPkpDGE7v2YbDCfocF9CKwLTzfo/1Nox/pb6BM+euI4VxaWXvag4u3Y2Ey NCy5NPsA==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50128 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1hFrmd-0031Wy-Dh; Sun, 14 Apr 2019 21:55:47 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hFrmd-0031Wy-Dh X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:50128 X-Source-Auth: lawlist X-Email-Count: 1 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 192.185.51.196 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:235469 Archived-At: 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 > To: Keith David Bershatsky > 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. > > * * *