array operators

  • Thread starter Thread starter PJ6
  • Start date Start date
P

PJ6

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
 
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
 
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
 
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
 
Back
Top