develooper Front page | perl.perl5.porters | Postings from January 2011

Time to update POSIX.pm?

Thread Next
From:
Mark Overmeer
Date:
January 29, 2011 14:49
Subject:
Time to update POSIX.pm?
Message ID:
20110129224852.GA13900@moon.overmeer.net

Greetz,

In ancient history, memory was short and modules were small. It is the
time of autosplit. However, I would call to reconsider autosplit for
POSIX.pm...

The unsplit POSIX.pm file is 1024 lines (21kb).  It does not use function
signatures, but checks parameter list length manually...

When autosplit, POSIX fragment total to 2100 lines in 150 files (54kb).
Most of these files are 12 lines with only 1 line payload. Opening a
file is an expensive OS call, usually much more expensive than compiling
a few dozen lines of code.

In general, autosplit may hiddenly burden Perl scripts which run
in daemons like mod_perl; you do not want to load code dynamically.
The triggering of autoloading can be hard to predict and difficult
to discover.

Attached is my compact rework of the POSIX module (434 lines, 15kb), as
example how small the module actually is. No regression tests run yet.
All fancy tricks removed. But it may trigger some debate first ;-)
-- 
Regards,
               MarkOv

------------------------------------------------------------------------
       Mark Overmeer MSc                                MARKOV Solutions
       Mark@Overmeer.net                          solutions@overmeer.net
http://Mark.Overmeer.net                   http://solutions.overmeer.net


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About