symbol_table: Prehash the key on insert, and reuse the entry on shadowing.
authorEmma Anholt <emma@anholt.net>
Wed, 12 Apr 2023 19:13:24 +0000 (12:13 -0700)
committerMarge Bot <emma+marge@anholt.net>
Sat, 15 Apr 2023 18:33:25 +0000 (18:33 +0000)
commit00b9685d966c8abeadd58102850f5b26f133b10f
tree21d8846fbc1bd14042118a11915ecb5ca3db2b37
parent46498abbacb1a59cd37aa54ba5d7b9ca703ae059
symbol_table: Prehash the key on insert, and reuse the entry on shadowing.

Mostly saves computing the hash twice, but while we're here there's no
need for shadowing to walk the table again.

Release Mesa build runtime of
KHR-Single-GL46.arrays_of_arrays_gl.SizedDeclarationsPrimitive -4.19869%
+/- 3.20231%

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22451>
src/mesa/program/symbol_table.c