array operators

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

    #1

    array operators

    I'm looking for a way to increase performance on a few rather simple integer
    array operations, such as adding the values of one to another. I know I can
    do this procedurally, but was wondering if there wasn't some sort of "mass"
    operation that would be faster, and can be done in one command. Is there?

    Paul



  • Cor Ligthert [MVP]

    #2
    Re: array operators

    PJ6,

    Be aware that the 8086 processor familly and descents have a small set of
    instructions, this means that your mass operation will still be a lot of
    processing. Therefore look how values are stored and you are halfway your
    question. Avoid boxing, avoid fixed arrays.

    By instance this seems a clever instruction using late binding
    dim c as integer = 10
    dim d as decimal = 10
    dim c as double = myadder(b, c)
    c = myadder(c, a)

    public function myadder(byval b as object, c as object) as object
    return b + c
    end sub

    However it is not, it cost very much processor cycles

    Cor



    "PJ6" <noone@nowhere. net> schreef in bericht
    news:ujezUPhcGH A.1856@TK2MSFTN GP03.phx.gbl...[color=blue]
    > I'm looking for a way to increase performance on a few rather simple
    > integer
    > array operations, such as adding the values of one to another. I know I
    > can
    > do this procedurally, but was wondering if there wasn't some sort of
    > "mass"
    > operation that would be faster, and can be done in one command. Is there?
    >
    > Paul
    >
    >
    >[/color]


    Comment

    • PJ6

      #3
      Re: array operators

      Very well, but I also know that there are "bitblt" operations that are
      (supposedly) insanely fast with large amounts of data, this is what I was
      after.

      Some of what I'm doing can be performed with Matrix operations, but I don't
      really know if that is any faster than a vanilla interative procedure,
      either.

      Paul

      "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> wrote in message
      news:uX$jnUmcGH A.5116@TK2MSFTN GP04.phx.gbl...[color=blue]
      > PJ6,
      >
      > Be aware that the 8086 processor familly and descents have a small set of
      > instructions, this means that your mass operation will still be a lot of
      > processing. Therefore look how values are stored and you are halfway your
      > question. Avoid boxing, avoid fixed arrays.
      >
      > By instance this seems a clever instruction using late binding
      > dim c as integer = 10
      > dim d as decimal = 10
      > dim c as double = myadder(b, c)
      > c = myadder(c, a)
      >
      > public function myadder(byval b as object, c as object) as object
      > return b + c
      > end sub
      >
      > However it is not, it cost very much processor cycles
      >
      > Cor
      >
      >
      >
      > "PJ6" <noone@nowhere. net> schreef in bericht
      > news:ujezUPhcGH A.1856@TK2MSFTN GP03.phx.gbl...[color=green]
      >> I'm looking for a way to increase performance on a few rather simple
      >> integer
      >> array operations, such as adding the values of one to another. I know I
      >> can
      >> do this procedurally, but was wondering if there wasn't some sort of
      >> "mass"
      >> operation that would be faster, and can be done in one command. Is there?
      >>
      >> Paul
      >>
      >>
      >>[/color]
      >
      >[/color]


      Comment

      • PJ6

        #4
        Re: array operators

        OK I found a better approach...

        Storing and operating on partial derivatives (along the y-axis) of the data
        reduced the number of required calculations by 1-2 orders of magnitude.

        I'm sure if I had been a computer science major this would have been the
        first thing to occur to me... but I guess I'm just glad it came to me at
        all.

        Paul

        "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> wrote in message
        news:uX$jnUmcGH A.5116@TK2MSFTN GP04.phx.gbl...[color=blue]
        > PJ6,
        >
        > Be aware that the 8086 processor familly and descents have a small set of
        > instructions, this means that your mass operation will still be a lot of
        > processing. Therefore look how values are stored and you are halfway your
        > question. Avoid boxing, avoid fixed arrays.
        >
        > By instance this seems a clever instruction using late binding
        > dim c as integer = 10
        > dim d as decimal = 10
        > dim c as double = myadder(b, c)
        > c = myadder(c, a)
        >
        > public function myadder(byval b as object, c as object) as object
        > return b + c
        > end sub
        >
        > However it is not, it cost very much processor cycles
        >
        > Cor
        >
        >
        >
        > "PJ6" <noone@nowhere. net> schreef in bericht
        > news:ujezUPhcGH A.1856@TK2MSFTN GP03.phx.gbl...[color=green]
        >> I'm looking for a way to increase performance on a few rather simple
        >> integer
        >> array operations, such as adding the values of one to another. I know I
        >> can
        >> do this procedurally, but was wondering if there wasn't some sort of
        >> "mass"
        >> operation that would be faster, and can be done in one command. Is there?
        >>
        >> Paul
        >>
        >>
        >>[/color]
        >
        >[/color]


        Comment

        Working...