[Pixman] [RFC] Performance statistics analyzer

Maarten Bosmans mkbosmans at gmail.com
Wed Sep 7 06:46:48 PDT 2011

2011/9/6 Taekyun Kim <podain77 at gmail.com>:
> Hi,
> Currently pixman is used as a lowlevel backend for various applications.
> For doing analysis on performance, it might be desirable to provide some
> performance statistics information to developers.
> The basic idea is based on siarhei's slow-path-reporter. I extended it to
> accumulate information of every composite paths. Final result will be
> shown at the end of the application when destructor is called. Each paths
> are sorted by the amount of time they spent.

Indeed, this is very useful.

> The main purpose of this utility is to profile cairo traces. We can easily
> figure out hot spots and real world usage patterns.
> You can see it from here.
>     http://cgit.freedesktop.org/~podain/pixman/?h=perf_stat
> You can give --enable-perf-stat option to configure script to enable the
> performance statistics analyzer. (I'm not sure that this is done right,
> because I'm not familiar with autoconf, but it works anyway)
> Is it right or good to include this feature within upstream? I think other
> developers can easily profile their applications and report the statistics
> when they suffer from performance.
> I was thinking of some performance log channel, individual composite
> event is printed though that log channel and statistics analysis utilities
> to retrieve meaningful information from the log.
> All suggestions and comments are welcome.

I took this RFC to also be a request for patches.
Attached is a patch that strips out the pthread mutex usage and
implements some macros in pixman-compiler.h, not unlike the TLS
macros. I also added a win32 implementation and tested it using mingw.

Some further improvements could be: check whether the win32
implementation works with MSVC and use it there too. And also a way of
opting out if you're on a non-win32, non-pthread platform and don't
want multithreading.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-pthread-and-win32-mutex-implementation-and-use-i.patch
Type: application/octet-stream
Size: 5394 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/pixman/attachments/20110907/17b3bc7c/attachment.obj>

More information about the Pixman mailing list