optimizing a program that just shuffles data, a bit like cat...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dan Stromberg

    #1

    optimizing a program that just shuffles data, a bit like cat...


    ....but with much bigger blocksizes, and with a netcat-like ability to use
    sockets.

    The program is at http://dcs.nac.uci.edu/~strombrg/pnetcat

    I'm a bit concerned about the program's performance, because it actually
    seems to get slower sometimes with larger blocksizes, which really isn't
    what I'd been expecting. Also the megabits/second I'm getting isn't
    really stellar either, at least not when using it on an optical network
    (fibre and optical switching).

    Also, is there any way to make len(big_buffer) fast, or to speed up or
    eliminate the string slicing required (?) to handle partial writes?

    Thanks a bunch!

    (I'll put up a descriptive web page on the program later, when I have a
    little bit more time. But for now, you can get a usage message with the
    -h flag)


  • Oracle

    #2
    Re: optimizing a program that just shuffles data, a bit like cat...

    On Fri, 23 Sep 2005 01:16:46 +0000, Dan Stromberg wrote:
    [color=blue]
    >
    > ...but with much bigger blocksizes, and with a netcat-like ability to use
    > sockets.
    >[/color]

    Try using psyco and see if that helps. Also, sometimes smaller blocks are
    better than large blocks. Try using smaller block sizes and see if that
    helps.

    If you're worried about the time required to calculate the length of your
    block, try calculating it once and pass the length around. Is that doable?


    Comment

    • Dan Stromberg

      #3
      Re: optimizing a program that just shuffles data, a bit like cat...

      On Fri, 23 Sep 2005 10:18:47 -0500, Oracle wrote:
      [color=blue]
      > On Fri, 23 Sep 2005 01:16:46 +0000, Dan Stromberg wrote:
      >[color=green]
      >> [quoted text muted][/color]
      >
      > Try using psyco and see if that helps. Also, sometimes smaller blocks are
      > better than large blocks. Try using smaller block sizes and see if that
      > helps.[/color]

      I like the psyco idea, but I'm on an AIX system with a powerpc CPU, rather
      than an x86 CPU.
      [color=blue]
      > If you're worried about the time required to calculate[/color]
      the length of[color=blue]
      > your block, try calculating it once and pass the length around. Is that
      > doable?[/color]

      AFAIK, that's what I've been doing...

      Thanks!

      Comment

      Working...