Start a new topic

Performance of web app under Wikitude plugin

Performance of web app under Wikitude plugin


For both Android and iPhone, but especially iPhone, the Wikitude plugin seems to use a lot of CPU. This makes the web app running there very slow and uses a lot of battery. I'm using PhoneGap, but the same seems to be true when using Wikitude app with developer URL set.

To test: Try loading http://knappen.konge.net/KNappen/Main.html in a phone browser and from Wikitude app (developer url) to see the difference. (Note, zoom in to Oslo, Norway and click once on the map to perform a manual search - then results in list, map and AR will show)

Using Xcode to dig in a bit it seems most CPU is used pulling compass and gyro.

The whole app runs inside Wikitude/ARWorld since communication with PhoneGap to run the rest there would be way to complicated. Whenever AR view is not active the camera is disabled. The method used to disable camera is located in http://knappen.konge.net/KNappen/JS/System/Providers/WikitudeProvider.js and uses "AR.context.services.camera = false/true"

/**
* Change state of AR camera
* @method System.Providers.WikitudeProvider#enableAR
* @param {bool} state True=enable AR camera, False=disable AR camera
*/
WikitudeProvider.prototype.enableAR = function (state) {
try {
log.debug("WikitudeProvider", "Setting AR camera state to: " + state);
if (this.arState == state) {
this.arState = state;
AR.context.services.camera = state;
} else {
log.debug("WikitudeProvider", "AR camera state already: " + state);
}
} catch (e) {
log.error("WikitudeProvider", "Error changing AR camera state: " + e);
}
};


 

Is there something I can do to make it use less CPU when AR is not active?

Hi,

Maybe you want to stop and start the WTArchitectView if it is not visible. Resuming the WTArchitectView is very quick and while the view is stopped, it uses zero cpu power.

Best regards

Andreas

I may be mistaking, but stopping WTArchitectView (from PhoneGap) would close the whole webpage running inside Wikitude? The whole app runs as a single page inside Wikitude plugin.

Hi,

do you know that you can also turn the sensors off? AR.context.services.sensors = false/true.

Best regards

Andreas

Thanks, that seems to help a lot. App is more responsive on both platforms.
Login or Signup to post a comment