Commit graph

84 commits

Author SHA1 Message Date
Bryce Harrington
2c5af590dd Refactor ARRAY_LENGTH macro definitions in test code 2014-11-20 12:22:06 -08:00
Bryce Harrington
cd11a4ff04 perf: Refactor some common macros to cairo-perf.h
These macros are standard in src's cairoint.h and test's cairo-test.h
internal header files, so for consistency do the same thing with perf's
cairo-perf.h.

Reviewed-by: Uli Schlachter <psychon@znc.in>
2014-04-18 10:09:10 -07:00
Chris Wilson
9a12c2e023 perf: Rudimentary histogram printing for cairo-perf-print
If you call ./cairo-perf-print --histogram results.txt, it will then
print a histogram of the results, one per test. Ideally, you should see
a skewed distribution (with a negative skew representing that most results
run in optimal time), but random sampling errors (scheduling,
throttling, general inefficiency etc) will push it more towards a normal
distribution.

For example,
|                                                             x                |
|                                                             x xx             |
|                                                             x xx             |
|                                                             x xx             |
|                                                             xxxx             |
|                                                             xxxx x           |
|                                                          x  xxxxxx           |
|                                                          x  xxxxxx           |
|                                                          xxxxxxxxx           |
|                                                          xxxxxxxxx           |
|                                                          xxxxxxxxx           |
|                                                         xxxxxxxxxxxx         |
|                                                         xxxxxxxxxxxx         |
|                                                         xxxxxxxxxxxx         |
|                                                        xxxxxxxxxxxxxx        |
|x                                                       xxxxxxxxxxxxxx        |
|x x                                                     xxxxxxxxxxxxxxx       |
|x x                                                     xxxxxxxxxxxxxxx       |
|x x                                                    xxxxxxxxxxxxxxxxx      |
|xxx                                                 x xxxxxxxxxxxxxxxxxxx     |
|xxx                                                xxxxxxxxxxxxxxxxxxxxxxxxx  |
|xxxxxx xxxx x x x   x xxx xx xxxxx xxx x xxx x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
.------------------------------------------------------------------------------.
 xlib           firefox-fishtank  8298.44 1.53% (829/946)

Starts off reasonably, but quickly deteriorates as the integrated CPU/GPU
overheats and is forced to throttle.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-11 11:30:43 +01:00
Chris Wilson
ffbf6158be perf: Add an a1-pixel variant
Just to measure the overhead and differences when switching between
antialiasing paths.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-15 10:13:40 +01:00
Chris Wilson
db41096b38 perf/micro: Add the PS tiger as a measure for the antialias hints
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-14 19:22:24 +01:00
Chris Wilson
af9fbd176b Introduce a new compositor architecture
Having spent the last dev cycle looking at how we could specialize the
compositors for various backends, we once again look for the
commonalities in order to reduce the duplication. In part this is
motivated by the idea that spans is a good interface for both the
existent GL backend and pixman, and so they deserve a dedicated
compositor. xcb/xlib target an identical rendering system and so they
should be using the same compositor, and it should be possible to run
that same compositor locally against pixman to generate reference tests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

P.S. This brings massive upheaval (read breakage) I've tried delaying in
order to fix as many things as possible but now this one patch does far,
far, far too much. Apologies in advance for breaking your favourite
backend, but trust me in that the end result will be much better. :)
2011-09-12 08:29:48 +01:00
Andrea Canciani
dcd3e2cde1 perf: Get rid of cairo_perf_ticks_per_second()
The cairo_time_from_s() and cairo_time_to_s() functions should be used
instead.
2011-09-02 12:45:49 +02:00
Andrea Canciani
9172e2aec0 perf: Drop cairo_perf_ticks_t in favor of cairo_time_t
cairo_time_t offers a superset of the functions provided by
cairo_perf_ticks_t.
2011-09-02 12:45:49 +02:00
Andrea Canciani
2855ff4666 perf: Reuse cairo-time
Instead of redefining time getters, use the generic one provided by
_cairo_time_*.
2011-09-02 12:45:49 +02:00
Chris Wilson
6cdad1931a observe: Provide the sum of the elapsed time of the individual operations
We can use the elapsed time of the indiividual operations to profile the
synchronous throughput of a trace and eliminate all replay overhead. At
the cost of running the trace synchronously of course.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-23 14:41:10 +01:00
Chris Wilson
2e545672ba perf/micro: diagonal lines
The ideal benchmark for spans?...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-13 09:30:26 +01:00
Chris Wilson
e9d41054f9 perf/micro: Test wide vs hairline strokes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-13 09:30:26 +01:00
Chris Wilson
d22cf3dfbe perf: add curve
Time how long it takes to stroke and fill a single Bezier curve.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-09 20:20:18 +01:00
Chris Wilson
aa6df71228 perf: add many-curves
Continuing the theme of stressing the tessellators, draw lots of Bezier
curves!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-09 19:47:49 +01:00
Chris Wilson
786d4b2a2a perf: Add many-fills
A variant of many-strokes tries to answer the question of how much
overhead is there in stroking, i.e. if we fill an equivalent path to a
set of strokes, do we see an equivalence in performance?

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-09 16:06:50 +01:00
Chris Wilson
d953161f88 perf: Add many-strokes
An intersection variant to exercise the stroker with many, many lines. A
silly benchmark, but a popular one in the wild.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-07 12:14:11 +01:00
Andrea Canciani
374b26ff03 perf: Add hash table benchmark
A benchmark to test the speed of hash tables when inserting and
removing a huge number of elements.

Although originally hash tables were assumed not to get many
deletions, in practice they are now being used as caches in multiple
places. This means that they often have a fixed number of live
elements and an element is evicted whenever a new element is inserted
(this happens explicitly for cairo_cache_t objects, but also, for
example, in scaled_font_map + holdovers). This access pattern is very
inefficient with the current implementation.
2011-08-03 12:31:41 +02:00
Chris Wilson
9ab9ecfdbd test,perf: Another hatching!
This one illustrates the quadratic explosion lurking in the clipping
code.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-19 00:32:45 +01:00
Chris Wilson
3a29365713 tests,perf: Add a hatchings clip-test
A benchmark to test how close we get to reducing paint+clip to an ordinary
fill, and to check correctness.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-18 10:31:25 +01:00
Chris Wilson
52f79bfcf3 perf/micro: Add wave
Benjamin just demonstrated this funky trick for generating pixel
outlines, and as no good deed should go unpunished, I've added his code
to the perf suite.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-01 19:17:06 +01:00
Chris Wilson
c6c3bdba4b perf: Only print description once per backend
Currently we print the backend description before every time, which is
overly verbose. As the information doesn't^Wshouldn't change, simply
print it before running the first test of each target.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-20 14:26:37 +01:00
M Joonas Pihlaja
b036a09972 whitespace: Fixup formal arguments and tabs in boilerplate/ and perf/.
Ran a script to align the formal parameters of functions and
collapse spaces to tabs in code.
2010-06-24 15:02:53 +03:00
Chris Wilson
72481acf0d perf: Compute ops per second
Provide a hook for the test to be able to compute the number of ops per
second. For instance, the glyphs test uses it to report the number of
kiloglyph per second Cairo is able to render.
2010-03-30 15:28:37 +01:00
M Joonas Pihlaja
270b2f1be0 [perf] Add a fast-and-sloppy mode to cairo-perf.
A new -f option to cairo-perf reverts to a fast run
mode for quick performance overviews. The number of
milliseconds each iteration of a test is run for can
be overriden using the new CAIRO_PERF_ITERATION_MS
environment variable. The default remains 2000 ms/iter.
2009-09-05 05:50:57 +03:00
Chris Wilson
bdd3c5ba69 [perf] Match directory names
In order to handle 'cairo-perf-trace benchmark', we need to perform the
can_run? test on the directory name as opposed to the individual trace
names. Make it so.
2009-08-29 08:08:26 +01:00
Chris Wilson
0db9e010fa [perf] Calibrate tests to run for at least 2 seconds
By ensuring that tests take longer than a couple of seconds we eliminate
systematic errors in our measurements. However, we also effectively
eliminate the synchronisation overhead. To compensate, we attempt to
estimate the overhead by reporting the difference between a single
instance and the minimum averaged instance.
2009-08-06 10:15:40 +01:00
Chris Wilson
b7f68d3518 [perf] Enable trace directory recursion.
I have an idea to categorise traces within their own subdirectories and so
for convenience added path walking to cairo-perf-trace. Principally this
should allow for forests of symlinks of all types.
2009-06-30 20:46:12 +01:00
Chris Wilson
a41e1275d2 [boilerplate] Make array of targets const.
Protect the boilerplate targets from unexpected modifications.
2009-06-12 22:28:38 +01:00
Chris Wilson
42c0aee1d9 [perf] Add a -x to exclude traces from a benchmark.
Read names of traces to exclude from a file specified using -x on the
commandline, i.e.
$ ./cairo-perf-trace -x cairo-traces/tiny.exclude

This is a convenient method for me to exclude certain traces for
particular machines. For example tiny cannot run
firefox-36-20090609.trace as that has a greater working set than the
available RAM on tiny.
2009-06-11 13:00:31 +01:00
Chris Wilson
4e11d56f8e [perf] Update trace summary after each iteration
Running the macro-benchmarks takes so long, feedback is important.
2009-06-04 11:16:48 +01:00
Chris Wilson
403f780b29 [perf] Add a verbose flag for summary output with raw
Use 'cairo-perf -v -r' to have both the summary output along with the raw
values. This gives a progress report whilst benchmarking, very reassuring
with long running tests.
2009-06-02 15:13:47 +01:00
Chris Wilson
bc49cb377c [perf] Benchmark mixing different masks and sources 2009-06-02 15:13:47 +01:00
Chris Wilson
4aca84ddb2 [perf] Add a pure glyphs performance metric
Use the new API Behdad exposed in 1.8 to precompute a glyph string using
Cairo and then benchmark cairo_show_glyphs(). This is then equivalent to
the text benchmark but without the extra step of converting to glyphs on
every call to cairo_show_text() i.e. it shows the underlying glyph
rendering performance.
2009-06-02 15:13:46 +01:00
Chris Wilson
655f698733 [perf] Split can_run? into a separate precondition.
Allow tests to skip unnecessary setup when pruning the list of perf cases.
2009-02-13 13:26:53 +00:00
Chris Wilson
6801f28f6d [perf] Add a utility to compare backends.
A minor variation on cairo-perf-diff-files that compares tests with the
same name for multiple backends.
2009-01-14 16:51:09 +00:00
M Joonas Pihlaja
afba0c3129 [perf] Add perf tests to hit rectilinear code paths.
These tests look at the differences in code paths
hit by filling paths that are rectilinear (or not) and
pixel aligned (or not) with the even-odd and non-zero
fill rules.  The paths are not simple, so they don't
hit the special case quad/triangle tessellator.
2008-12-06 13:30:29 +02:00
M Joonas Pihlaja
8ec58113df [perf] Explicitly test rendering a path with lots of intersections.
We don't have one just for this purpose.  The only other
path with many intersections that gets actually rendered is zrusin-another,
but that might be sped up in the future (say by identifying
collinearities up front or something like that.)
2008-12-06 13:21:44 +02:00
Chris Wilson
7657bda017 [perf/pythagoras_tree] Another fractal.
Test lots of rectangles and recursion path construction.
2008-11-19 14:06:10 +00:00
Chris Wilson
abd0a2627d [perf/dragon] Add a dragon curve perf case.
Inspired by http://labs.trolltech.com/blogs/2007/08/31/rasterizing-dragons/
and http://en.wikipedia.org/wiki/Dragon_curve, add a performance test case
to measure drawing this space-filling fractal curve.
2008-11-19 14:06:10 +00:00
Chris Wilson
4f2f46ef1b Restore the ability to choose the internal font.
Behdad wants to include the feature with 1.10, so we enable it as early as
possible in 1.9 dev cycle to generate as much feedback as possible.

The first change is to use "<cairo>" as being a name unlikely to clash
with any real font names.

This reverts commits:
  a824d284be,
  2922336855,
  e0046aaf41,
  f534bd549e.
2008-10-30 19:14:45 +00:00
Carl Worth
e0046aaf41 Remove twin perf case.
This performance test relied on the recently-removed ability
to select the internal twin-based font family with a name of
"cairo".

Presumably, we'll want to bring this performance case back when
some other means of requesting that font face is added.
2008-10-29 16:26:39 -07:00
Chris Wilson
09651a1c1a Twin perf case 2008-10-22 16:38:12 +01:00
Chris Wilson
f2ff794426 [perf] A crude tool to visualise performance changes across a series.
Generate a cairo-perf-diff graph for a series of commits in order to be
able to identify significant commits. Still very crude, but minimally
functional.
2008-10-19 09:36:53 +01:00
Björn Lindqvist
f644d78dc1 [perf] Add composite performance test.
Add a new test case to Cairo for checking the performance of Cairo's
equivalent to GDK's gdk_pixbuf_composite_color() operation. That is an
operation that happens to be extremely useful when viewing or editing
transparent images so I think it is important that it is as fast as
possible.
2008-10-08 20:10:27 +01:00
Chris Wilson
0a7d781ab0 [perf] Add rounded rectangle perf case.
Add the performance test case to compare the speed of filling a rounded
rectangle (one with camphered corners) as opposed to an ordinary
rectangle. Since the majority of the pixels are identical, ideally the two
cases would take similar times (modulo the additional overhead in the more
complex path).
2008-09-28 18:59:43 +01:00
Chris Wilson
ac44817c4a [cairo-perf] Only allocate arrays once.
Store the array of times on the cairo_perf_t context to avoid
reallocating it for every perf-case.
2008-06-13 21:34:42 +01:00
Azar@.(none)
95db215cc1 Some fixes and improvements to the Win32 build 2008-02-06 21:45:24 -05:00
Vladimir Vukicevic
2477e57de5 [perf] Add pixman_region_init_rects and use in extract_region
Avoid O(N*N) loop in traps_extract_region by letting us hand pixman
an array of rects all at once.
2007-06-18 14:02:41 -07:00
Carl Worth
72b812be8c perf: Add new paint-with-alpha test
MacSlow noticed that cairo_paint_with_alpha is much slower than
it should be, (and jrmuizel has a nice plan for fixing the
performance bug).
2007-04-25 07:24:23 -07:00
Dan Amelang
382e021ccb Add "rectangles" perf test
This test draws many small, solid pixel-aligned rectangles one at a
time.
2007-01-31 11:53:06 -08:00