Subject: | support for XSLoader |
Please add XSLoader support, for it is much faster than DynaLoader.
With DynaLoader:
perl -MCompress::Zlib -e1 0,29s user 0,01s system 97% cpu 0,307 total
perl -MCompress::Zlib -e1 0,28s user 0,02s system 96% cpu 0,309 total
perl -MCompress::Zlib -e1 0,29s user 0,01s system 97% cpu 0,308 total
With XSLoader:
perl -MCompress::Zlib -e1 0,25s user 0,01s system 98% cpu 0,263 total
perl -MCompress::Zlib -e1 0,25s user 0,00s system 95% cpu 0,263 total
perl -MCompress::Zlib -e1 0,23s user 0,02s system 95% cpu 0,262 total
--- Compress-Zlib-1.34/Zlib.pm- 2005-01-31 00:12:24 +0300
+++ Compress-Zlib-1.34/Zlib.pm 2005-06-26 07:32:38 +0400
@@ -12,7 +12,6 @@
require 5.004 ;
require Exporter;
-require DynaLoader;
use AutoLoader;
use Carp ;
use IO::Handle ;
@@ -24,7 +23,7 @@
$VERSION = "1.34" ;
-@ISA = qw(Exporter DynaLoader);
+@ISA = qw(Exporter);
# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.
@@ -91,7 +90,15 @@
goto &{$AUTOLOAD};
}
-bootstrap Compress::Zlib $VERSION ;
+eval {
+ require XSLoader;
+ XSLoader::load('Compress::Zlib', $VERSION);
+ 1;
+} or do {
+ require DynaLoader;
+ local @ISA = qw(DynaLoader);
+ bootstrap Compress::Zlib $VERSION ;
+};
# Preloaded methods go here.
End of patch
--
Alexey Tourbin
ALT Linux Team