[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Excessive use of `eassert`
From: |
Stefan Monnier |
Subject: |
Excessive use of `eassert` |
Date: |
Thu, 18 Jan 2024 17:35:53 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Building with ENABLE_CHECKING results in an Emacs that's
substantially slower. To some extent, this is unavoidable, but
cd .../src
rm process.o
make CFLAGS="-Winline -O2 -DHAVE_CONFIG_H" process.o |&
grep make_lisp_symbol
shows that `make_lisp_symbol` is not inlined, so NILP(x) ends up being
an actual function call to a function calling another function ....
which I think is definitely in the "excessive" camp :-)
The patch below seems to address this specific issue, tho I haven't
measured its performance impact yet.
Stefan
diff --git a/src/lisp.h b/src/lisp.h
index 914d6dd9b07..6b47b92972a 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1176,7 +1176,7 @@ make_lisp_symbol (struct Lisp_Symbol *sym)
cast to char * rather than to intptr_t. */
char *symoffset = (char *) ((char *) sym - (char *) lispsym);
Lisp_Object a = TAG_PTR (Lisp_Symbol, symoffset);
- eassert (XSYMBOL (a) == sym);
+ /* eassert (XSYMBOL (a) == sym); */
return a;
}
- Excessive use of `eassert`,
Stefan Monnier <=
- Re: Excessive use of `eassert`, Eli Zaretskii, 2024/01/19
- Re: Excessive use of `eassert`, Alan Mackenzie, 2024/01/19
- Re: Excessive use of `eassert`, Eli Zaretskii, 2024/01/19
- Re: Excessive use of `eassert`, Paul Eggert, 2024/01/20
- Re: Excessive use of `eassert`, Eli Zaretskii, 2024/01/21