Re: Questions about Inline::C
- From: Mirco Wahab <peace.is.our.profession@xxxxxx>
- Date: Thu, 28 Sep 2006 10:57:40 +0200
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
.
- Follow-Ups:
- Re: Questions about Inline::C
- From: January Weiner
- Re: Questions about Inline::C
- References:
- Questions about Inline::C
- From: January Weiner
- Questions about Inline::C
- Prev by Date: Re: Deleting characters from the end of each line
- Next by Date: Re: FTP from Perl script on Windows
- Previous by thread: Questions about Inline::C
- Next by thread: Re: Questions about Inline::C
- Index(es):
Relevant Pages
|