On 27.06.2017 00:15, Marek Olšák wrote:
On Thu, Jun 22, 2017 at 9:19 AM, Nicolai Hähnle <nhaeh...@gmail.com> wrote:
On 20.06.2017 20:00, Marek Olšák wrote:

From: Marek Olšák <marek.ol...@amd.com>

sizeof(struct si_shader_key):
    Before reverting the 2 commits: 120 bytes
    After reverting the 2 commits: 128 bytes
    With #pragma pack: 107 bytes

I'm not sure if memcmp with a byte-aligned size is a good idea.


Does this have a measurable impact? The code is nicer to read with the
structure after the patches, but I'm not sure it's worth the risk of getting
misaligned data somewhere.

It decreases the time spent in si_update_shaders by 6% when going from
128 bytes to 106 for the shader key.

What do you mean by the risk?

If we end up accidentally misaligning a member, that could cause a performance hit. But those 6% improvement does seem worth it. I do think Emil's suggestion of adding the attribute directly to the structures is a good idea. With that, the patch is

Reviewed-by: Nicolai Hähnle <nicolai.haeh...@amd.com>



Marek



--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to