[Piglit] [PATCH 0/6] make gen_vs_in_fp64 run faster

Dylan Baker dylan at pnwbakers.com
Tue Jun 7 21:15:07 UTC 2016

This recently introduced generator is rather slow, even on a relatively
fast processor. On my system it takes 4 minutes to run with a hot mako
cache, and nearly 6 minutes with a cold cache. This is in comparison to
this series which runs in about 1 minute on my system, with only about 1
second to fill the cache.

This series first goes after some low hanging optimizations in the
generator itself, building lists out of generators when there isn't any
need to, using interable chaining instead of building lists, and
converting some functions that build lists into generators. While that
work (the first 3 patches) manages to get some improvement, it isn't

There is a patch for shader_runner in here that the last two patches
need. It's pretty trivial and I've tested that it doesn't break anything

The final two patches give all the performance. By reworking the mako I
was about to cut 3/4 of the run time. There are some things about these
patches that could be better, they're pretty naive reimplementations of
the original templates, and if we wanted we could probably further
improve the runtime of the generator. But ~260 tests a second seems
pretty good to me for performance.

Dylan Baker (6):
  generators/gen_vs_in_fp64: don't list-ize generators for no reason.
  generators/gen_vs_in_fp64: don't store the filenames print them
  generators/gen_vs_in_fp64: use more generators/iterators save more
  shader_runner: Allow whitespace before [require] declarations
  generators/gen_vs_in_fp64: Rewrite the columns test generator
  generators/gen_vs_in_fp64: reimplement require_execution template

 generated_tests/CMakeLists.txt                     |   7 +-
 generated_tests/gen_vs_in_fp64.py                  |  90 +++++-------
 generated_tests/templates/gen_vs_in_fp64/base.mako |  27 ----
 .../gen_vs_in_fp64/columns.shader_test.mako        | 137 ++++++++++++++++++
 .../columns_execution.vert.shader_test.mako        |  41 ------
 .../gen_vs_in_fp64/columns_shader.vert.mako        |  17 ---
 .../gen_vs_in_fp64/execution.vert.shader_test.mako |  32 ----
 .../templates/gen_vs_in_fp64/execution_base.mako   |  85 -----------
 .../gen_vs_in_fp64/regular.shader_test.mako        | 161 +++++++++++++++++++++
 .../regular_execution.vert.shader_test.mako        |  67 ---------
 .../gen_vs_in_fp64/regular_shader.vert.mako        |  19 ---
 .../templates/gen_vs_in_fp64/shader.vert.mako      |  16 --
 .../templates/gen_vs_in_fp64/shader_base.mako      |  12 --
 tests/shaders/shader_runner.c                      |   5 +
 14 files changed, 339 insertions(+), 377 deletions(-)
 delete mode 100644 generated_tests/templates/gen_vs_in_fp64/base.mako
 create mode 100644 generated_tests/templates/gen_vs_in_fp64/columns.shader_test.mako
 delete mode 100644 generated_tests/templates/gen_vs_in_fp64/columns_execution.vert.shader_test.mako
 delete mode 100644 generated_tests/templates/gen_vs_in_fp64/columns_shader.vert.mako
 delete mode 100644 generated_tests/templates/gen_vs_in_fp64/execution.vert.shader_test.mako
 delete mode 100644 generated_tests/templates/gen_vs_in_fp64/execution_base.mako
 create mode 100644 generated_tests/templates/gen_vs_in_fp64/regular.shader_test.mako
 delete mode 100644 generated_tests/templates/gen_vs_in_fp64/regular_execution.vert.shader_test.mako
 delete mode 100644 generated_tests/templates/gen_vs_in_fp64/regular_shader.vert.mako
 delete mode 100644 generated_tests/templates/gen_vs_in_fp64/shader.vert.mako
 delete mode 100644 generated_tests/templates/gen_vs_in_fp64/shader_base.mako


More information about the Piglit mailing list