Subject: | support for XSLoader |
Please add support for XSLoader. XSLoader is noticeably faster than DynaLoader.
With DynaLoader:
perl -MTime::HiRes -e1 0,15s user 0,00s system 96% cpu 0,156 total
perl -MTime::HiRes -e1 0,14s user 0,01s system 94% cpu 0,159 total
perl -MTime::HiRes -e1 0,13s user 0,02s system 95% cpu 0,157 total
With XSLoader:
perl -MTime::HiRes -e1 0,10s user 0,01s system 98% cpu 0,112 total
perl -MTime::HiRes -e1 0,09s user 0,01s system 90% cpu 0,111 total
perl -MTime::HiRes -e1 0,09s user 0,01s system 90% cpu 0,111 total
--- Time-HiRes-1.68/HiRes.pm- 2005-05-14 08:07:42 +0000
+++ Time-HiRes-1.68/HiRes.pm 2005-06-25 09:27:01 +0000
@@ -4,9 +4,7 @@ use strict;
use vars qw($VERSION $XS_VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);
require Exporter;
-require DynaLoader;
-
-@ISA = qw(Exporter DynaLoader);
+@ISA = qw(Exporter);
@EXPORT = qw( );
@EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval
@@ -32,7 +30,15 @@ sub AUTOLOAD {
goto &$AUTOLOAD;
}
-bootstrap Time::HiRes;
+eval {
+ require XSLoader;
+ XSLoader::load('Time::HiRes', $XS_VERSION);
+ 1;
+} or do {
+ require DynaLoader;
+ local @ISA = qw(DynaLoader);
+ bootstrap Time::HiRes $XS_VERSION;
+};
# Preloaded methods go here.
End of patch
--
Alexey Tourbin
ALT Linux Team