[Piglit] refactor and optimize OpenGL test generators
jason at jlekstrand.net
Wed Nov 12 16:05:49 PST 2014
What did you do (besides verifying that the tests pass) to ensure that the
generated result is equivalent to the previous generator? Have you
verified that they generate basically the same code?
On Wed, Nov 12, 2014 at 3:45 PM, Dylan Baker <baker.dylan.c at gmail.com>
> This rather lengthy series takes a strong stab at cleaning up the python
> generators, particularly the OpenGL generators, with the exception of
> the generators that rely on the builtin_function.py and
> builtin_funciton_fp64.py (I have another series underway to deal with
> those, but one thing at a time).
> There are 4 goals for each generator in this series:
> 1) Use mako:
> There on generator (gen_interpolation_tests) that didn't use mako
> before this series. There are also several generators that nominally
> use mako, but don't take advantage of it's features, instead relying
> on python functions and blocks when mako is better equipped to handle
> the problem itself
> 2) Make it fast:
> Mako is faster than string concatenation, but there are also some
> really stupid things going on in these generators. For example Some
> of them loop over the same very large container several times when
> they could be combined.
> 3) Make it clean:
> The style of these ranges from pretty good, to pretty bad. There is a
> lot of C-in-python code here, and a lot of use of sub-optimal
> functions, like range instead of xrange, dict.items() instead of
> dict.iteritems(), etc
> 4) Split the templates:
> This both helps with speed and cleanliness. It makes it clean because
> the templates don't clutter the python scripts, in some cases the
> templates are as long as the script itself. It also means we can use
> a module_directory, which will speed up rebuilds significantly.
> Finally, as a bonus, the last patch splits the generators targets for
> the generators so that the OpenGL and OpenCL generators aren't linked by
> default. This allows OpenGL developers and OpenCL developers to save
> time with generated tests they aren't going to run.
> Despite all of the work this ends up being a was for LOC, in 45 patches
> we gain ~100 lines.
> I noticed on my system ~2 second decrease for OpenGL test generation,
> and about a ~5 second decrease for OpenGL test regeneration (using
> cached templates)
> This is available at my github:
> https://github.com/dcbaker/piglit submit/generator-cleanups
> Piglit mailing list
> Piglit at lists.freedesktop.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Piglit