Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > comparison of different syslog implementations

Reply
Thread Tools

comparison of different syslog implementations

 
 
Rainer Weikusat
Guest
Posts: n/a
 
      07-09-2013
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.
 
Reply With Quote
 
 
 
 
Rainer Weikusat
Guest
Posts: n/a
 
      07-09-2013
Rainer Weikusat <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
perl 5.8.8 make test hangs on ext/Sys/Syslog/t/syslog................... indefinitely Bad Dog Perl Misc 0 08-09-2007 04:47 PM
is there any API available to implement Syslog server using Java (to capture all syslog messages - UDP protocol, port 514)? santa19992000@yahoo.com Java 2 06-20-2006 12:54 PM
comparison of JavaScript implementations? jyang825@gmail.com Javascript 1 09-16-2005 09:21 PM
Syslog replay script for centralized syslog host leroy isaac Perl Misc 1 10-29-2004 04:23 AM
what are different jvm implementations in market? Naresh Agarwal Java 2 01-08-2004 03:20 PM



Advertisments