Re: Questions about Inline::C



Thus spoke January Weiner (on 2006-09-28 09:58):

I had to revert to C again. Since the thought of parsing all my files in C
was dreadful, I decided to use Inline::C to only do the job that was really
computationally intensive. Currently, my program seems to run quite well,
I am very happy with Inline::C, and a little coding in C made me bless
Larry again and again.

One question in advance: Why use Inline::C if
your C-Program is what counts. Why don't you
simply link the 'perl' to your program and
call it with the stuff you need. This is,
in large projects (imho) *much* simpler than
vice versa.

Use a _static_ PerlInterpreter*, so your
perl will keep state during whole program run.

I much prefer to do the allocation myself,
as I know exactly how large my matrix is and as I want to allocate the
whole matrix ( say, double 2000 x 2000 ) in one go myself. The reason is
that I fear that using perl guts for my calculations (accessing the
matrix, calculating values in it etc.) will be not much slower than a
simple C implementation. Maybe I am wrong, I haven't tested it.

Perl will be much slower if used trivially so (I can tell
you this). Just use your matrix in C as usual and make
some Into-Perl-Calls if necessary, eg. by pack(...)-ing
your variables into Perl-scalars and unpacking
them again in the perl.

Regards

Mirco
.



Relevant Pages

  • Re: lies about OOP
    ... He thinks that OOP has more overhead and is slower than ... Perl) which is compiled to a bytecode which is then interpreted.... ...
    (comp.lang.python)
  • Re: Perl vs. Python for text manipulation
    ... slower than perl for text manipulation simply because of this IO ... post process it in python to get acceptable performance. ... The perl "built-in" idioms for text processing is not only a syntactic ... Ganesan R ...
    (comp.lang.python)
  • Re: Slow script
    ... works in a specific environment. ... I did not expect folks here to pinpoint ... >>I have a script I inherited that was developed under perl 5.004. ... It runs much much slower. ...
    (comp.lang.perl.misc)
  • Re: Math
    ... I realize that any math in Perl is probably slower than the same math ... In my experience, perl is generally slower for heavy number crunching, ... blb8 at po dot cwru dot edu ...
    (comp.lang.perl.misc)
  • Is perl 5.8 slower than 5.005_03?
    ... Is perl 5.8 slower than perl 5.005_03? ... We rebuilt one of three webserver machines with solaris 5.8 and added ... I noticed that our website seemed slower with this new configuration. ...
    (comp.lang.perl.misc)