Speed comparisons - LWP and database access

T

trashman.horlicks

Hi all,
I'm writing a two-block application, the first in C++, and the second
in perl (for cgi/webforms); at the moment, I am unsure as to whether to
write the whole lot in perl because its easier :)

I'd like to ask a few questions if possible:
How fast is LWP compared to comparable C/C++ socket open,close,receive
calls etc.? LWP seems to be a more compact way of doing parsing of URLs
but how much latency does perl add to the speed overhead?
Secondly, for simple MySql calls to open,close,read,write a database,
how well does C/C++ compare to Perl ?

TIA

Paul
 
X

xhoster

Hi all,
I'm writing a two-block application, the first in C++, and the second
in perl (for cgi/webforms); at the moment, I am unsure as to whether to
write the whole lot in perl because its easier :)

I'd like to ask a few questions if possible:
How fast is LWP compared to comparable C/C++ socket open,close,receive
calls etc.? LWP seems to be a more compact way of doing parsing of URLs
but how much latency does perl add to the speed overhead?

I expect the http server you are talking to will add way more latency
than any difference between C++ and Perl that you will see in this regard.
Secondly, for simple MySql calls to open,close,read,write a database,
how well does C/C++ compare to Perl ?

Same thing, I'd expect the work that the database server had to do to
handle your request would swamp any differences on the client side.

Xho
 
A

anno4000

Hi all,
I'm writing a two-block application, the first in C++, and the second
in perl (for cgi/webforms); at the moment, I am unsure as to whether to
write the whole lot in perl because its easier :)

Go ahead!
I'd like to ask a few questions if possible:
How fast is LWP compared to comparable C/C++ socket open,close,receive
calls etc.? LWP seems to be a more compact way of doing parsing of URLs
but how much latency does perl add to the speed overhead?
Secondly, for simple MySql calls to open,close,read,write a database,
how well does C/C++ compare to Perl ?

I am inclined to join Xho in predicting that the time will be consumed
elsewhere. The difference in time efficiency will be small. A Perl
solution may take more memory.

Independent of that, I'd suggest writing both parts in Perl. If it
turns out (unlikely) that some part *is* a bottleneck, rewrite it
in C++ or whatever.

That may sound like an invitation to do part of the job twice, but
the second time through most of the design is already done, it's
just the implementation language that changes. You will also have
a working prototype while working on the change, which is a big
advantage. Most importantly, you'll do the change only with that
part of the code that actually needs it.

Anno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top