On Fri, Apr 16, 2010 at 03:10:19PM +0300, Tiago Vignatti wrote:
> Some Linux systems might not want to link against rt and pthread libraries
> simply to implement monotonic clock (GetTimeInMillis). For those, use a direct
> syscall instead. This is discouraged if someone doesn't know what's doing.
> 
> This patch keeps the new syscall version disabled by default - therefore not
> changing the original behaviour of the xserver build.
> 
> One, using this patch, should worry about a possible performance degradation
> due it's not going through optimized code in C library. Therefore, the simple
> program bellow (kudos to Adam Jackson) should performs equally in the 
> practice,
> for both syscall and C library implementation:
> 
>   #ifdef SYSCALL_MONOTONIC_CLOCK
>   #define clock_gettime(a, b) syscall(SYS_clock_gettime, a, b)
>   #endif
>   [...]
> 
> Signed-off-by: Tiago Vignatti <[email protected]>
> ---
> Myself, ajax, alanc and others discussed already on IRC about the performance
> degradation. We all ran the program above, obtaining equally results within
> different environments.

Jesus wept.  We've spent the last six years _deleting_ this kind of
code. ;) Was there any actual performance degradation from linking librt
in the end, or was it just about memory usage? I remember the Intel guys
saying that just linking to libpthread made lock overhead show up in
their profiles, but IIRC the solution to that was to remove superfluous
locks ...

Cheers,
Daniel

Attachment: pgp9ptpyTINHX.pgp
Description: PGP signature

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to