Commit graph

382 commits

Author SHA1 Message Date
Nis Martensen
77da76ac6c doc: fix a few typos found by codespell
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-10 10:20:28 +01:00
Andrea Canciani
58f79a85b0 perf: Don't use a boolean value as integer
Although in this case the boolean values are guaranteed to be 1/0,
using them as true/false (in an if condition) seems much saner than
using them to limit the number of iterations on a for loop.

Fixes:

cairo-perf-micro.c:221:5: warning: cannot optimize possibly infinite
loops [-Wunsafe-loop-optimizations]
2012-02-20 12:32:54 +01:00
Chris Wilson
42ad7a2385 perf/chart: Make the columns transculent so that the label behind is visible
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-11 12:43:43 +00:00
Chris Wilson
23ca558a05 perf/chart: Show values next to the column if too small to fit inside
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-11 12:43:43 +00:00
Chris Wilson
56a835eb9d perf/chart: Tweak labels on right not to fall off the edge
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-11 12:43:43 +00:00
Chris Wilson
9ecc3aafca perf: Compile fix, add the index to cairo_perf_report_load()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-18 10:04:12 +00:00
Andrea Canciani
c65d4e35dc Use xstrdup instead of xmalloc when possible
Don't open code xstrdup, just use it.
2011-11-12 20:49:08 +01:00
Andrea Canciani
549b1f8d4b boilerplate: Remove unused thread id parameter
The thread id is not used anymore (it is always == 0), so it can be
removed.
2011-11-12 20:49:08 +01:00
Andrea Canciani
c8b5d270f6 Improve the documentation of the flags
Some utilities were providing incorrect or incomplete usage
information.
2011-11-12 20:49:08 +01:00
Andrea Canciani
6a0ba30303 Sort option flags
Keep the option flags in alphabetical order. This makes it easier to
check for collisions or missing handlers.

Avoids an internal error when passing flags -c, -r or -v to
cairo-analyse-trace.
2011-11-12 20:49:08 +01:00
Andrea Canciani
f96e78fa54 Silence some 'unused var' warnings 2011-11-09 13:56:50 +01:00
Chris Wilson
2cb4eb53fe perf 2011-10-11 09:05:44 +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
05a73434fc perf/stats: Avoid overflow when summing time-squared
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-13 12:30:58 +01:00
Chris Wilson
a6a48e0559 test: Update ref images
First pass after the recent turmoil in clip and antialias handling.
2011-09-12 15:44:47 +01:00
Chris Wilson
0f26f75eda perf/micro: Add measurement of setting the pixel directly using pixman
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-12 15:44:46 +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
Chris Wilson
d8ac76bcec perf/Makefile.am: Add missing '\' line continuation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-09 19:43:48 +01:00
Andrea Canciani
761ef7ae8b cairo-missing: Fix and cleanup ssize_t type definition
The definition of ssize_t is needed in cairo-missing.h and can be
dropped from files which include it.
2011-09-04 16:23:37 -07:00
Andrea Canciani
1bcc27985f perf: Fix win32 build
Microsoft C Compiler complains about:

hash-table.c(44) : error C2466: cannot allocate an array of constant
size 0

Adding an unused element makes it happy.
2011-09-02 12:52:47 +02:00
Andrea Canciani
297aa4d4a0 perf: Fix readme
The README in perf/ was not updated when cairo-perf.c was renamed to
cairo-perf-micro.c
2011-09-02 12:45:49 +02: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
Andrea Canciani
6d6bfbd641 Introduce the cairo-missing library
The cairo-missing library provides the functions which are needed in
order to correctly compile cairo (or its utilities) and which were not
found during configuration.

Fixes the build on MacOS X Lion, which failed because of collisons
between the cairo internal getline and strndup and those in libc:

cairo-analyse-trace.c:282: error: static declaration of ‘getline’ follows non-static declaration
/usr/include/stdio.h:449: error: previous declaration of ‘getline’ was here
cairo-analyse-trace.c:307: error: static declaration of ‘strndup’ follows non-static declaration
...
2011-09-02 12:27:13 +02:00
Andrea Canciani
0101a54579 time: Add cairo_time_t type
Add the cairo_time_t type (currently based on cairo_uint64_t) and use
it in cairo-observer and in the perf suite.

Fixes the build on MacOS X (for the src/ subdir) and Win32, whch
failed because they don't provide clock_gettime:

cairo-surface-observer.c:629: error: implicit declaration of function 'clock_gettime'
cairo-surface-observer.c:629: warning: nested extern declaration of 'clock_gettime'
cairo-surface-observer.c:629: error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
...
2011-09-02 12:27:13 +02:00
Andrea Canciani
6fd174b423 perf: Silence gcc warning
Silence:

dragon.c: In function 'do_dragon_solid':
dragon.c:167: warning: unused variable 'r'
2011-09-02 12:00:29 +02:00
Chris Wilson
6b1daace57 perf: Print a summary of each operation for a trace (using '-s')
In order for this to be effective on small system we also need to
disable the recording of the long traces which exhaust all memory...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-30 13:28:47 +01: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
0efdc8d27e observer: record all operations and their timings
The immediate use of this is to print out the slowest operation of each
type in a replayable manner. A continuing demonstration of how we may
analyse traces...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-20 11:51:50 +01:00
Chris Wilson
713c8069be perf: Cleanup target after each run
As the trace may leak surfaces over its lifetime, we are forced to
teardown the connection between runs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-19 22:32:31 +01:00
Chris Wilson
eee66899cd Introduce cairo_surface_observer_t for performance analysis
Another logging passthrough surface that records the style of operations
performed trying to categorise what is slow/fast/important.

In combination with perf/cairo-analyse-trace it is very useful for
understanding what a trace does. The next steps for this tool would be
to identify the slow operations that the trace does. Baby steps.

This should be generally useful in similar situations outside of perf/
and should be extensible to become an online performance probe.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 20:54:53 +01:00
Chris Wilson
6d1c0e6d28 Fix pollution from skia commit
I forgot to proof-read the patch before pushing and forgot I had left in
some damage from trying to get skia to link using libtool.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-13 10:06:08 +01:00
Chris Wilson
1ccd269a3f skia: Update to use cairo_backend_t interface
Still hopelessly broken. Requires compiling cairo to use static linking
and then still requires manual linkage to workaround libtool. Lots of
functionality is still absent - we need to either find analogues to some
Cairo operations or implement fallbacks - but it is sufficient to
investigate how Skia functions in direct comparison with Cairo for
tessellation/rasterisation.

Caveat emptor.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-13 09:58:02 +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
f646cb07a9 perf: add the usual special cases to many-strokes
For completeness, also compare [aligned] horizontal and vertical
strokes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-07 12:27:39 +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
Chris Wilson
1e8d56ceeb perf: Add stroke/fill variants to world-map
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-05 09:48:14 +01:00
Uli Schlachter
971d42302c perf: Also build the code in perf/micro
This fixes weird and occasional build failures when updating the source, e.g.:

cairo-perf-micro.o:(.rodata+0xb0): undefined reference to `hash_table'

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-04 21:10:09 +02: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
c5405f7324 perf: Save/restore gstate across runs
Reset the cairo_t to the initial state so that subsequent tests are not
affected by earlier tests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-01 12:59:06 +01:00
Chris Wilson
fec80f1199 perf: Add a few more variations to dragon to exercise unaligned lines/spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-01 12:08:55 +01:00
Andrea Canciani
e04e368748 Remove useless checks for NULL before freeing
This patch has been generated by the following Coccinelle semantic patch:
// Remove useless checks for NULL before freeing
//
// free (NULL) is a no-op, so there is no need to avoid it

@@
expression E;
@@
+ free (E);
+ E = NULL;
- if (unlikely (E != NULL)) {
-   free(E);
(
-   E = NULL;
|
-   E = 0;
)
   ...
- }

@@
expression E;
@@
+ free (E);
- if (unlikely (E != NULL)) {
-   free (E);
- }
2011-07-31 16:46:36 +02:00
Andrea Canciani
e8e765605c Silence gcc warnings 2011-07-29 10:51:19 +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