[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NS port: How to debug excessive garbage collection?
From: |
Keith David Bershatsky |
Subject: |
Re: NS port: How to debug excessive garbage collection? |
Date: |
Mon, 15 Apr 2019 19:57:48 -0700 |
I am working on implementing the suggestion of Alex to use structures to store
the data for each fake cursor on a per window basis, instead of the prior
method that created a Lisp_Object of cons cells (causing the excessive garbage
collection issue).
It seemed to me that the implementation of creating the vector to store glyph
rows looked somewhat similar to what we want to do here. I attempted to borrow
a portion of that vector glyph row implementation in the attached working
example that applies to the master branch as of 04/08/2019
(a038df77de7b1aa2d73a6478493b8838b59e4982).
I had hoped to keep the cache (w->mc_elts) alive for the duration that the fake
cursors feature is active in a visible window. However, the cache (w->mc_elts)
disappears and becomes NULL. In the attached example, whenever it is time to
increase the size of the dynamic vector, I set the value of w->mc_elts[99].x to
99. The value of -1 is used in the stderr printout whenever w->mc_elts is NULL.
How can I make the cache (w->mc_elts) persistent without automatically becoming
NULL?
In the attached example, I launch Emacs after applying the patch and evaluate:
(setq crosshairs t)
w->mc_nelts (100) | w->mc_elts_allocated (100) | w->mc_elts[99].x (99)
w->mc_nelts (200) | w->mc_elts_allocated (200) | w->mc_elts[99].x (99)
w->mc_nelts (300) | w->mc_elts_allocated (300) | w->mc_elts[99].x (99)
w->mc_nelts (400) | w->mc_elts_allocated (450) | w->mc_elts[99].x (99)
w->mc_nelts (500) | w->mc_elts_allocated (675) | w->mc_elts[99].x (99)
w->mc_nelts (600) | w->mc_elts_allocated (675) | w->mc_elts[99].x (-1)
w->mc_nelts (700) | w->mc_elts_allocated (1012) | w->mc_elts[99].x (99)
w->mc_nelts (800) | w->mc_elts_allocated (1012) | w->mc_elts[99].x (-1)
w->mc_nelts (900) | w->mc_elts_allocated (1012) | w->mc_elts[99].x (-1)
w->mc_nelts (1000) | w->mc_elts_allocated (1012) | w->mc_elts[99].x (-1)
w->mc_nelts (1100) | w->mc_elts_allocated (1518) | w->mc_elts[99].x (99)
w->mc_nelts (1200) | w->mc_elts_allocated (1518) | w->mc_elts[99].x (-1)
w->mc_nelts (1300) | w->mc_elts_allocated (1518) | w->mc_elts[99].x (-1)
w->mc_nelts (1400) | w->mc_elts_allocated (1518) | w->mc_elts[99].x (-1)
w->mc_nelts (1500) | w->mc_elts_allocated (1518) | w->mc_elts[99].x (-1)
w->mc_nelts (1600) | w->mc_elts_allocated (2277) | w->mc_elts[99].x (99)
2019_04_15__19_36_14_173.diff
Description: application/diff