[32721] in Perl-Users-Digest
Perl-Users Digest, Issue: 3985 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 9 21:09:27 2013
Date: Tue, 9 Jul 2013 18:09:04 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 9 Jul 2013 Volume: 11 Number: 3985
Today's topics:
comparison of different syslog implementations <rweikusat@mssgmbh.com>
Re: comparison of different syslog implementations <rweikusat@mssgmbh.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 09 Jul 2013 16:34:55 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: comparison of different syslog implementations
Message-Id: <87obabeogw.fsf@sapphire.mobileactivedefense.com>
NB: This includes Sys::Syslog because 'it is part of Perl' and doesn't
include Net::Syslog because it is - like Sys::Syslog - really an
alternate syslog client implementation (according to its
documentation), something I'm not really interested in because I want
to use the C libary syslog support.
Timing in this text come from NYTProf running through the 'startup'
phase of a particular program (logs about ~330 messsages on the
verbosity level where it is used 'in production').
Sys::Syslog
-----------
(AFAIK) 'pure Perl' heavy-weight and feature-rich 'syslog client'
which talks 'syslog protocol' to a syslog server reachable via 'some
kind of socket connection'.
The central message logging routine looks like this:
sub msg
{
local $@ if $@;
syslog('notice', @_);
}
It needs to localize $@ because the syslog routine uses eval (AFAIK,
for various tests). On average, it ran for 180us per call.
Unix::Syslog
------------
'Mostly-XS' interface to the syslog routines in the C library. Message
formatting done via sprintf-call in Perl wrapper routine. Supports %m
in the same way as Sys::Syslog (using the same line of code,
actually). The syslog constants are provided as hand-written XS
functions which need to be executed whenever the value of such a
'constant' is needed.
The central message logging routine looks like this:
sub msg
{
syslog(LOG_NOTICE, $_[0], @_[1 .. $#_]);
}
This way of passing arguments is necessary because the syslog-routine
has a prototype of $$@ which implies that it can't work with an array
of arguments encompassing both the format string and the 'data bits'.
On average, it ran for 70us per call, about 2.57 times the speed of
the Sys::Syslog-based routine.
'syslog weekend project'
------------------------
'Minimal' XS-only (for the working code) interface to the syslog
routines in the C library. Message formatting is done via perlapi
call from the XS-code. Does not support %m because the cost of doing
so is IMHO not sensible, compared to the marginal inconvenience of
having to use %s and "$!" as formatting argument for that. The syslog
constants are 'real' Perl constants (no runtime calls to anything
involved) created based on the h2xs 'constant support code' (which
also does runtime functions calls).
The central message logging routine looks like this
sub msg
{
syslog(LOG_NOTICE, @_);
}
On average, it ran for 54us per call, about 3.33 times the speed of
the Sys::Syslog routine and about 1.23 times the speed of the
Unix::Syslog routine.
------------------------------
Date: Tue, 09 Jul 2013 18:16:23 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: comparison of different syslog implementations
Message-Id: <87ip0jlkm0.fsf@sapphire.mobileactivedefense.com>
Rainer Weikusat <rweikusat@mssgmbh.com> writes:
[...]
> 'syslog weekend project'
> ------------------------
For the semi-unlikely case that this is of interest to anyone: At
least for now, the code can be downloaded from here:
http://mss-uk.mssgmbh.com/~rw/UNIX-Syslog-0.01-1.tar.gz
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 3985
***************************************