bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#37321: 27.0.50; Excessive gc in a use case (el-search)


From: Eli Zaretskii
Subject: bug#37321: 27.0.50; Excessive gc in a use case (el-search)
Date: Wed, 09 Oct 2019 18:33:12 +0300

> From: Michael Heerdegen <michael_heerdegen@web.de>
> Cc: eggert@cs.ucla.edu,  37321@debbugs.gnu.org
> Date: Wed, 09 Oct 2019 16:47:58 +0200
> 
> > AFAIK, the latter can only be done by changing your algorithms to
> > produce less garbage.
> 
> I tried to find out what code produces the most garbage.  It turned out
> that ca. 50% of garbage was generated by code that prevents infinite
> recursion when recursing into nested structures.  I use hash tables to
> collect visited objects, and the hash tables cause the garbage.  I tried
> to reuse hash tables and clear them after each use, but this makes the
> code much slower than what I win from gc.
> 
> But 99,9% of el-searched code isn't cyclic, so the effort is for nothing
> most of the time.  Is there an efficient way to find out if a given
> object is cyclic?

The hare/tortoise method we use in data.c?

Or maybe you could make your search non-recursive by using an
internal queue of requests (like in BFS vs DFS)?

(I wrote that based on 5 sec of thought, so maybe it makes no sense at
all.)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]