-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
Description
Currently each first (i.e. non-reentrant) request from Native to JS causes this behavior:
- Client calls
transit.eval(...) - Transit.java pushes EVAL-Job to the
actionsstack - Transit.java triggers
transit.poll()in Transit.js vialoadUrl - Transit.js does a prompt(POLL)
- Transit.java pops EVAL-Job from the
actionsstack and... - Transit.js receives EVAL-Job
- Transit.js processes EVAL-Job
- Transit.js returns result of EVAL-Job
- Transit.java creates a NULL-Job and...
- Transit.js receives a null-Job (end of poll)
- Client receives result of EVAL
Thus the following piece of code takes ~7200ms (on Samsung Galaxy Android 4.2.2) to run where 1000 sequential calls from JS to Native only take ~4000ms.
for (int i = 0; i < 1000; i++) {
transit.eval("someJSFunction()");
}This could be optimized by moving the EVAL-Payload to the loadUrl directly.