Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

OLE vs XS

by Flame (Deacon)
on Feb 21, 2004 at 06:05 UTC ( #330770=perlquestion: print w/ replies, xml ) Need Help??
Flame has asked for the wisdom of the Perl Monks concerning the following question:

Greetings fellow monks, I come with a simple and straightforward (I hope) question.

Which is faster (typically) Win32::OLE or XS?

There's a package I'm considering adapting to Perl which has both C/++ and OLE control.



My code doesn't have bugs, it just develops random features.

Flame

Comment on OLE vs XS
Re: OLE vs XS
by Mr. Muskrat (Abbot) on Feb 21, 2004 at 06:16 UTC

    I haven't benchmarked it or even run a comparison of any kind. However, I'd still say that XS would win hands down. Win32::OLE has a huge overhead and XS is pretty much just C code.

Re: OLE vs XS
by Courage (Parson) on Feb 21, 2004 at 10:10 UTC
    OLE is many times much slower, but you will be able to write pure-perl code for it.
    This means you will be able to maintain it with less efforts spent (otherwise do you support Borland? GCC/win32?)

    Besides, just because you clearly state that your code doesn't have bugs, this means it is no more than 10 lines. (otherwise you're just too optimistic).

    Courage, the Cowardly Dog

Re: OLE vs XS
by fizbin (Chaplain) on Feb 21, 2004 at 14:03 UTC
    Which is typically faster, a C program that interacts with this package via OLE or a C program that interacts with it via the provided C/C++ interface?

    I ask because some vendors spend much, much more time on the OLE interface (they're targeting the VB market) than they ever do on the "native" C/C++ interface. In fact, sometimes the C/C++ interface is really just a wrapper to a bunch of OLE calls.

    So ask yourself: how badly is this per-call efficiency needed? If it is needed badly enough, which interface really is faster, and is the faster interface sufficiently faster so as to make a difference?

    That said, it's also the case that some vendors will have an OLE interface that's just slapped on hurredly because marketing wanted it, whereas their real market is people who've been using their C/C++ libraries for years.

    So which interface would you rather work with, debug, and optimize code in? Win32::OLE plus the OLE interface to this package, or XS plus the C/C++ interface? The answer will depend on the package in question and what you're most comfortable programming in.

Re: OLE vs XS
by vladdrak (Monk) on Feb 22, 2004 at 03:56 UTC
    I would benchmark some of your frequent function calls and see, it depends on who wrote the library really and what you want to do with it.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://330770]
Approved by davido
Front-paged by Courage
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2014-08-23 17:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (175 votes), past polls