* Re: scratch/hash-table-perf 2d28042f56a 19/35: Use non-Lisp allocation for internal hash-table vectors
[not found] ` <20240104155642.B4A99C00344@vcs2.savannah.gnu.org>
@ 2024-01-04 17:32 ` Dmitry Gutov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Gutov @ 2024-01-04 17:32 UTC (permalink / raw)
To: emacs-devel, Mattias Engdegård
On 04/01/2024 17:56, Mattias Engdegård wrote:
> +/* Like xmalloc, but makes allocation count toward the total consing.
> + Return NULL for a zero-sized allocation. */
> +void *
> +hash_table_alloc_bytes (ptrdiff_t nbytes)
> +{
> + if (nbytes == 0)
> + return NULL;
> + tally_consing (nbytes);
> + return xmalloc (nbytes);
> +}
Sorry if it's a stupid question, but if the operation doesn't add any
Lisp "garbage", why increase the consing counter? That is likely
triggers more GCs earlier which otherwise might not run, and if there
are no slots to GC, it seems like they would run in vain.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: scratch/hash-table-perf 3e9e68333ae 16/35: Remove rehash-threshold and rehash-size struct members
[not found] ` <20240104155642.6326FC00344@vcs2.savannah.gnu.org>
@ 2024-01-04 18:52 ` Dmitry Gutov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Gutov @ 2024-01-04 18:52 UTC (permalink / raw)
To: emacs-devel, Mattias Engdegård
On 04/01/2024 17:56, Mattias Engdegård wrote:
> branch: scratch/hash-table-perf
> commit 3e9e68333ae15a6544e490851f80da3a8f9ef343
> Author: Mattias Engdegård<mattiase@acm.org>
> Commit: Mattias Engdegård<mattiase@acm.org>
>
> Remove rehash-threshold and rehash-size struct members
>
> These parameters have no visible semantics and are hardly ever used,
> so just use the default values for all hash tables. This saves
> memory, shrinks the external representation, and will improve
> performance.
I'm curious whether any of these callers have tested with different
values and found a difference in performance:
https://github.com/search?q=%3Arehash-threshold+language%3A%22Emacs+Lisp%22&type=code&l=Emacs+Lisp
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-04 18:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <170438379722.3921.9312235725296561206@vcs2.savannah.gnu.org>
[not found] ` <20240104155642.B4A99C00344@vcs2.savannah.gnu.org>
2024-01-04 17:32 ` scratch/hash-table-perf 2d28042f56a 19/35: Use non-Lisp allocation for internal hash-table vectors Dmitry Gutov
[not found] ` <20240104155642.6326FC00344@vcs2.savannah.gnu.org>
2024-01-04 18:52 ` scratch/hash-table-perf 3e9e68333ae 16/35: Remove rehash-threshold and rehash-size struct members Dmitry Gutov
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).