I’m trying to send a 1000 character data string back and forth from javascript to webgl. In my tests so far it takes about 500 ms to send 30 of them back and forth.
Why is communicating between js and unity so slow?
Is there any way to speed this up?
Webpage javascript:
var bigstring= 1000 character string;
function Start(){
JSMessageFromUnity(bigstring);
}
var counter=0;
function JSMessageFromUnity(s){
counter+=1;
if(counter>30)return;
SendMessage("main","UnityMessageFromJS",s);
}
UnityScript:
function UnityMessageFromJS(s:String){
Application.ExternalEval("JSMessageFromUnity('"+s+"')");
}