Re: table.foreach NYI

  • From: Finn Wilcox <finnw@xxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 13 Nov 2013 02:24:38 +0000

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/11/2013 22:39, Mike Pall wrote:
> but better check if the workaround isn't slower than the
> interpreter ...
> 
It's not just about the speed of the next() function.  Splitting the
trace has other side effects (forcing FFI scalar types to be boxed,
preventing allocation sinking, redundant int32_t->lua_Number->int32_t
conversions...)
And yes you can create a temporary array but that has its own costs -
Suspend the GC (commit charge) or keep it active (more cache misses)

And as for the speed of the next() function - I assume it is mostly
due to the branches necessary for probing hash slots?
Maybe one could do some bit twiddling to probe multiple slots in parallel?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.18 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSguLmAAoJEHp3pOlF38H/t6sIAI/p66MGc3p80rOuBgLdPTPU
vaXhkgwduWRBSFbHLJLvelsO3L9WK6s6NJfeHC+mZalghpq5xTgQ+W6OXqnRRqh0
8nmLE/f1cTzDiJLZjK6ejicPUsZqZcsjsFGKZlxAAMISgTrm1EJXZJ7vBLhMH4UT
4QnDL9k6JnOw6RlGapIzMfSZr0Sz59Yp27pi7kC/JQsL40jXNKMYSGzGT2muK8Sr
DRRrt9c8z0oRrMl0N5i+R2K6IIFlaLPGv6xt2/jHSUEn7IOV1xZtqkG2dYHXhUJR
7KbLkeFwHHD6KV5lwwLOdViHdSSnpTg0fMIjnyTtS2xQrypM2G3dCcQFjc563o8=
=GGVf
-----END PGP SIGNATURE-----

Other related posts: