Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister


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.


Replies are listed 'Best First'.
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 Mr. Muskrat (Canon) 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 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://330770]
Approved by davido
Front-paged by Courage
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2018-04-26 08:21 GMT
Find Nodes?
    Voting Booth?