From 22f478e2e2a12f595809e55cd56cde85e86f0022 Mon Sep 17 00:00:00 2001 From: Laurence Tratt Date: Mon, 10 Aug 2026 19:02:21 +0100 Subject: [PATCH] Unroll `genmoveresults`. This speeds up LuLpeg quite a bit, and has a very tiny negative impact on hashids. Overall, it seems worth it. --- src/ldo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ldo.c b/src/ldo.c index f7fd4ff..53799a9 100644 --- a/src/ldo.c +++ b/src/ldo.c @@ -545,6 +545,9 @@ static unsigned tryfuncTM (lua_State *L, StkId func, unsigned status) { /* Generic case for 'moveresult' */ +#ifdef USE_YK +__attribute__((yk_unroll)) +#endif l_sinline void genmoveresults (lua_State *L, StkId res, int nres, int wanted) { StkId firstresult = L->top.p - nres; /* index of first result */