Scalar::Util is not using XS in Fedora 8, leading to performance problem
by Gizbo » Wed, 28 Nov 2007 11:22:30 GMT
Hi,
I've very recently upgraded to Fedora 8 (with perl 5.8.8), and the
performance of my perl code tanked. With the help obtained in a
previous post (today's "performance problem" post, link below), I've
determined that the problem is the very high number of calls to
Scalar::Utils::refaddr(), for which the perl implementation is being
called instead of the C one.
The following shows that Scalar::Util does not see XS, for whatever
reason, and falls back to the slow perl implementation.
[me@hostname]$ perl -MScalar::Util=dualvar -e1
is only avaliable with the XS version at -e line 0
BEGIN failed--compilation aborted.
I am not sure what to do next -- no experience with XS. It was
suggested I reinstall Scalar::Util, but not sure if I do this via cpan
somehow, or even if that will fix the problem. Is there a CPAN module
I can install to fix this?
Thanks
http://www.**--****.com/ #0e8cd72a3e43af21
Re: Scalar::Util is not using XS in Fedora 8, leading to performance problem
by Gizbo » Wed, 28 Nov 2007 11:28:17 GMT
Well, I solved the problem after some more googling. For those it may
help, I simply did a force install of Scalar::Util, within the cpan
shell:
bash% cpan
cpan> force install Scalar::Util
This completely resolved the problem. Thanks to the guy in my
previous post who pointed me in the right direction.
Re: Scalar::Util is not using XS in Fedora 8, leading to performance problem
by Ben Morrow » Wed, 28 Nov 2007 12:10:58 GMT
Quoth Gizbo < XXXX@XXXXX.COM >:
Just out of interest: where did your original copy of S::U come from?
Did it come out of a rpm, or did you install it yourself and it failed
to find gcc? If Redhat are providing rpms with the pure-Perl version of
S::U, this could be quite a problem... :(.
Ben
Re: Scalar::Util is not using XS in Fedora 8, leading to performance problem
by Gizbo » Thu, 29 Nov 2007 02:17:36 GMT
> Just out of interest: where did your original copy of S::U come from?
Hi Ben,
As far as I know, our sysadmin installed the Red Hat distribution as
is, and we do have gcc installed. I can't say definitively whether
this is a problem with our installation or the distribution though.
Similar Threads:
1.Scalar::Util is not using XS in Fedora 8, leading to performance problem
>>>>> "BM" == Ben Morrow < XXXX@XXXXX.COM > writes:
BM> Just out of interest: where did your original copy of S::U
BM> come from? Did it come out of a rpm, or did you install it
BM> yourself and it failed to find gcc? If Redhat are providing
BM> rpms with the pure-Perl version of S::U, this could be quite a
BM> problem... :(.
They are (or at least were, the last time I dealt with them), and it
is.
Charlton
--
Charlton Wilbur
XXXX@XXXXX.COM
2.Perl DBI 1.50 Scalar::Util::weaken support test bug
3.&Compress::Zlib::gzopen and Scalar::Util errors
4.Problem using more than 1 module in Windows (XS) - please help
Hi all
I have a problem that I am running into while using Perl XS to build
an interface to my C++ library. This is on a windows machine with perl
5.6.1. I was able to use PerlXS to expose out different 'c++
classes' that my API supports. I wrote the .XS files for each of
these objects and now I am able to make a simple test.pl file and use
these objects from Perl. The problem comes when I try to use more than
1 object (module) in a single .pl file. Here would an example
========== working example perl script ================
use lib "C:/Documents and Settings/myusername/Desktop/perl
experiment/api";
use MyDataReader;
my $dr = new MyDataReader("hsd_demo_pre");
$dr->execQuery("select * from bug");
print "fields: " . $dr->getFieldCount() . "\n";
================== perl script giving problem =============
use lib "C:/Documents and Settings/myusername/Desktop/perl
experiment/api";
use MyDataReader;
use MyAdmin; # Adding this line gives problems
my $dr = new MyDataReader("hsd_demo_pre");
$dr->execQuery("select * from bug");
print "fields: " . $dr->getFieldCount() . "\n";
========= Error Message ==================
C:\Documents and Settings\myusername\Desktop\perl experiment\api>perl
test.pl
Can't load 'C:\Documents and Settings\ myusername \Desktop\perl
experiment\api/5.6.1
/MyAdmin.dll' for module MyAdmin: load_file:Attempt to access invalid
address at C
:/Perl/lib/DynaLoader.pm line 206.
Compilation failed in require at test.pl line 11.
BEGIN failed--compilation aborted at test.pl line 11.
So the problem shows up when I use more than one 'use' statements
in a perl script. Its important to note here that I can use the
'MyAdmin' module by itself just fine. So its not aproblem with that
module. The problem is only when I try to use more than 1 module in a
single perl script.
==================== Makefile.PL ===================
use ExtUtils::MakeMaker;
$CC = 'cl';
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile( 'NAME' => 'MyDataReader',
'VERSION' => '0.10',
'DEFINE' => '-TP -EHsc', # e.g., '-DHAVE_SOMETHING'
'CC' => $CC,
'LDDLFLAGS' => '-nologo -libpath:"C:\Perl\lib\CORE"
-machine:x86',
'LIBC' => 'msvcrtd.lib',
'LDLOADLIBS' => 'oldnames.lib kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib
version.lib odbc32.lib odbccp32.lib msvcrtd.lib',
'CCFLAGS' => '-nologo -O1 -MDd -DNDEBUG -DWIN32 -D_CONSOLE
-DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT
-DPERL_IMPLICIT_SYS -DPERL_MSVCRT_READFIX',
'LD' => '$(CC)',
'XSOPT' => '-C++',
'OPTIMIZE' => '-O1 -MDd -DNDEBUG',
'PERM_RW' => '664',
'PERM_RWX' => '775',
'TYPEMAPS' => ['perlobject.map'] ,
'INC' => "-Iinclude",
'MYEXTLIB' => 'lib\myexternalapi.lib'
);
========== end =========
5.I am having problems installing PDL using CPAN
6. Slow Performance When Using DBI, otherwise Not
7. log out to file using mp2 and apache2 on Fedora
8. Problems installing DBD-Interbase on Fedora