Skip to content

util/ra: A few improvements

Found those as part of trying to improve Intel shader compiler times. Together these will yield some improvements. Commit messages tell the details, summary of changes below:

  • Avoid storing the same pointer (that we already have available in stack) into the various individual entities. This applies for ra_node and re_reg. It is a consequence of using dynarray, we just stop using it.

  • Move some "cold" data outside the main ra_node array. This had some measurable effects on Intel. In particular for spill_cost it really make sense.

  • Tweaks the initial capacity for the adjacency list. My first intuition was to make this a configuration option (either ra_set_xxxx or making the 'constructor' take an options struct), but wasn't really sure if this also applied to others. Accept suggestions on how to proceed (or not) with this one.

Updated numbers I've got from fossils running on my TGL laptop:

// Batman Arkham City (n=13)
Difference at 95.0% confidence
        -6.9 +/- 0.17031
        -1.28601% +/- 0.0317422%
        (Student's t, pooled s = 0.210372)

// Borderlands 3 (n=13)
Difference at 95.0% confidence
        -0.163846 +/- 0.0869011
        -1.62261% +/- 0.860603%
        (Student's t, pooled s = 0.107343)

// Rise of the Tomb Raider (n=13)
Difference at 95.0% confidence
        -0.423077 +/- 0.0133467
        -1.31879% +/- 0.0416034%
        (Student's t, pooled s = 0.0164862)

// Total War Warhammer 3 (n=13)
Difference at 95.0% confidence
        -0.932308 +/- 0.0268503
        -0.817119% +/- 0.0235329%
        (Student's t, pooled s = 0.0331662)

Cyberpunk 2077 got almost no measurable difference.

Original measurements from the time the MR was initially posted

Numbers I've got from fossils running on a SKL NUC (Difference at 95.0% confidence):

  • Rise of the Tomb Rider: -1.6397% +/- 0.119877% (N=23)
  • Total War Warhammer 3: -1.21498% +/- 0.115492% (N=13)
  • Batman Arkham City: -1.3984% +/- 0.105162% (N=13)

And running on my TGL laptop:

  • Rise of the Tomb Rider: -1.76188% +/- 0.0759284% (N=9)
  • Total War Warhammer 3: -1.26313% +/- 0.177009% (N=13)
  • Batman Arkham City: -1.68594% +/- 0.0484479% (N=13)
Edited by Caio Oliveira

Merge request reports