|
-
April 14th, 2003, 08:49 PM
#1
Perl Sockets Slow?
Why is Perl's Sockets so slow?
example: scanner.pl
-foreach ($_) {
-opens a socket
-etc, etc, etc...
-closes socket }
This is really really slow (slower than winsock)!
Any ideas why Perl is so slow?
I've tested on BSD/Win2k...
yeah, I\'m gonna need that by friday...

-
April 14th, 2003, 09:21 PM
#2
Junior Member
'cause perl is interpreted and is converting its own byte-code to system calls on-the fly.
-C
-
April 14th, 2003, 09:24 PM
#3
If its a stand alone program use the Perl compiler that will greatly speed it up (converts it to byte code)
-
April 14th, 2003, 09:37 PM
#4
Junior Member
yes, I should've specified a bit more...
perl's execution cycle goes something along the lines of: integrity check, perl to byte-code conversion, byte-code to syscall conversion (to binary format such as elf or a.out.)
-C
-
April 14th, 2003, 10:42 PM
#5
here is a link to active state Perl they have a compilare for win32 Perl makes it run much faster stanalone (dose all the backend stuff beforehand insted of on the fly)
http://www.activestate.com/Products/Perl_Dev_Kit/
-
April 14th, 2003, 11:32 PM
#6
I have not found perl sockets slow.
Whilst interpreted perl may be slower than C, the vast majority of time is spent waiting for betwork responses. I have written TCP and UDP based programs which do scanning and fingerprinting in perl, and find it a highly suitable language for doing so.
The slowness from interpreting perl is measured in microseconds typically. Even on a fast network, network latency to other boxes on the LAN is greater. It is just not a signficant factor.
-
April 14th, 2003, 11:42 PM
#7
You can also try to make your program faster with "use strict;", but you will have to declare all of your variables before using them in this mode.
KC
Life is boring. Play NetHack... --more--

-
April 15th, 2003, 12:47 PM
#8
thanx for the replies
yeah, I\'m gonna need that by friday...

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|