Passing a million numbers from java to matlab?

I have some code that works in 10.919 s. Profiling shows that 10.182 s are lost in

opaque.double

What is called when using

jClass.GetArrays(jArray1,jArray2);

struct.prop1 = double(jArray1);
struct.prop2 = double(jArray1);

What can be done? I have to use Java to interact with an external API.


EDIT: I used the following hack:

struct.prop1 = cell2mat( cell( jArray1) ); 


And dropped to 1.5s / 2.2s

EDIT:

Creating a java backward long comma limited to the string representation of arrays and then using

data = strread(char(jString),'%f','delimiter',',' );

Almost acceptable performance produced

+3
source share
2 answers

In this case, the problem is using plug-in Java primitives - java.lang.Double .

Java Double double Matlab .

+3

, , . (, ), .

blob , .

, , .

-Adam

+1

Source: https://habr.com/ru/post/1702583/


All Articles