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...
Printable View
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...
'cause perl is interpreted and is converting its own byte-code to system calls on-the fly.
-C
If its a stand alone program use the Perl compiler that will greatly speed it up (converts it to byte code)
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
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/
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.
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
thanx for the replies :)