With DynaLoader:
perl -MStorable -e1  0,18s user 0,02s system 93% cpu 0,213 total
perl -MStorable -e1  0,20s user 0,00s system 96% cpu 0,207 total
perl -MStorable -e1  0,20s user 0,00s system 94% cpu 0,211 total

With XSLoader:
perl -MStorable -e1  0,15s user 0,02s system 98% cpu 0,172 total
perl -MStorable -e1  0,16s user 0,01s system 97% cpu 0,175 total
perl -MStorable -e1  0,16s user 0,01s system 97% cpu 0,175 total


--- perl-5.9.3.24982/ext/Storable/Storable.pm-  2005-06-21 15:55:27 +0000
+++ perl-5.9.3.24982/ext/Storable/Storable.pm   2005-06-27 01:05:08 +0000
@@ -5,9 +5,9 @@
 #  in the README file that comes with the distribution.
 #
 
-require DynaLoader;
+package Storable;
 require Exporter;
-package Storable; @ISA = qw(Exporter DynaLoader);
[EMAIL PROTECTED] = qw(Exporter);
 
 @EXPORT = qw(store retrieve);
 @EXPORT_OK = qw(
@@ -62,7 +62,15 @@ sub retrieve_fd { &fd_retrieve }             # Back
 
 $Storable::downgrade_restricted = 1;
 $Storable::accept_future_minor = 1;
-bootstrap Storable;
+eval {
+    require XSLoader;
+    XSLoader::load('Storable', $VERSION);
+    1;
+} or do {
+    require DynaLoader;
+    local @ISA = qw(DynaLoader);
+    bootstrap Storable $VERSION;
+};
 1;
 __END__
 #
End of patch

Since Storable is also on CPAN, the code is conditinal.  "local @ISA"
is tricky, I think I've seen this elsewhere.

Attachment: pgp2KEV9pX947.pgp
Description: PGP signature

Reply via email to