Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a project where I'm moving large arrays across a MAF pipeline to an addin and it's taking a very long time. I'm just passing arrays across calls through the pipeline with no deep copying or iterations.

To pass 3 arrays of 291,000 items, 1 array as long, 1 array as double and the other array as enums, takes 3,150ms. Getting an array of 291,000 doubles back takes less than 1ms.

In the Host
C#
addinFunction.SetArrays(array1, array2, array3);


in the actual addin the signature is

C#
public void SetArrays(long[] array1, double[] array2, myEnum[] array3);

both side adapters only do something like
C#
public void SetArrays(long[] array1, double[] array2, myEnum[] array3)
{
     _view.SetArrays(array1, array2, array2);
}

Anyone have any ideas or hints?

Many thanks in advance.
Hank
Posted
Updated 1-Sep-14 5:36am
v4

1 solution

join array
C#
var z = new int[x.Length + y.Length];
x.CopyTo(z, 0);
y.CopyTo(z, x.Length);

or change to byte
C#
byte[] firstArray = {2,45,79,33};
byte[] secondArray = {55,4,7,81};
byte[] result = firstArray.Concat(secondArray).ToArray();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900