Perl Sockets Slow?
Results 1 to 8 of 8

Thread: Perl Sockets Slow?

  1. #1
    Senior Member tampabay420's Avatar
    Join Date
    Aug 2002
    Posts
    953

    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...

  2. #2
    Junior Member
    Join Date
    Apr 2003
    Posts
    24
    'cause perl is interpreted and is converting its own byte-code to system calls on-the fly.

    -C

  3. #3
    Senior Member
    Join Date
    Mar 2003
    Location
    central il
    Posts
    1,779
    If its a stand alone program use the Perl compiler that will greatly speed it up (converts it to byte code)

  4. #4
    Junior Member
    Join Date
    Apr 2003
    Posts
    24
    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

  5. #5
    Senior Member
    Join Date
    Mar 2003
    Location
    central il
    Posts
    1,779
    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/

  6. #6
    Senior Member
    Join Date
    Jan 2002
    Posts
    1,207
    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.

  7. #7
    Senior Member
    Join Date
    Apr 2002
    Posts
    634
    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--

  8. #8
    Senior Member tampabay420's Avatar
    Join Date
    Aug 2002
    Posts
    953
    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
  •