[Mesa-dev] [PATCH 0/7] Prehash all the things

Thomas Helland thomashelland90 at gmail.com
Sat Feb 4 21:53:42 UTC 2017


Let's just put this whole thing on the shelf for now. I'm not quite sure
what happened, but I have probably measured the effect of some other
changes sometime when profiling, cause this series has no effect at all
within the margin of error. I'm seeing a 0.5% speedup on shader-db.
Definitely not worth the added complexity. I'll clean up the other
patches that I have laying and post those instead, as they can actually
have a certain impact on things.

2017-02-02 21:57 GMT+01:00 Thomas Helland <thomashelland90 at gmail.com>:
> This series converts multiple users of the hash table to reuse the
> hash when searching, and then inserting an element if the search did
> not find an entry. Since we have the functionality we should take
> advantage of it to lower the number of calls to the hashing functions.
> I'm not quite sold on the first patch, but the rest I like. I'll work
> on getting some performance numbers up shortly.
>
> PS: This will not show any effect if built with asserts, as the hash
> table implementation asserts that the pre_hash is correct by doing
> a hash of the key inside an assert. So if one wants to benchmark this
> one will need to take care of that.
>
> Thomas Helland (7):
>   mesa: Avoid unnecessary string hashing in symbol table
>   util: Avoid computing hash twice in string_to_uint_map
>   glsl: Prehash to avoid computing the hash twice
>   glsl: Prehash to avoid hashing two times when inserting
>   glsl: Don't hash two times when inserting in constant propagation
>   nir: Prehash in instr_set to avoid unnecessary hashing
>   glsl: Hash only once if inserting new elemnt in refcount hash table
>
>  src/compiler/glsl/ir_variable_refcount.cpp          |  7 +++++--
>  src/compiler/glsl/opt_constant_propagation.cpp      |  8 +++++---
>  src/compiler/glsl/opt_constant_variable.cpp         |  6 ++++--
>  src/compiler/glsl/opt_copy_propagation_elements.cpp |  7 +++++--
>  src/compiler/nir/nir_instr_set.c                    |  8 ++++++--
>  src/mesa/program/symbol_table.c                     | 20 +++++++++++++-------
>  src/util/string_to_uint_map.h                       |  9 ++++++---
>  7 files changed, 44 insertions(+), 21 deletions(-)
>
> --
> 2.11.0
>


More information about the mesa-dev mailing list