Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.

Requiring iotivity-node takes ~2 seconds #153

Open
johnandersen777 opened this issue Sep 15, 2017 · 2 comments
Open

Requiring iotivity-node takes ~2 seconds #153

johnandersen777 opened this issue Sep 15, 2017 · 2 comments

Comments

@johnandersen777
Copy link

johnandersen777 commented Sep 15, 2017

iotivity-node takes ~2 seconds to load because of the iotivity.OCInit call in csdk.js

Require takes ~2 seconds

This is from 01org/iot-rest-api-server/handlers/ocfHandler.js

var startDate = new Date();
var DEV = require('iotivity-node').client;
console.log('iotivity-node:', (new Date()) - startDate); startDate = new Date();

iotivity.OCInit call

stackOKOrThrow( iotivity.OCInit( null, 0, iotivity.OCMode.OC_CLIENT_SERVER ), "OCInit() failed" );

This takes ~2 seconds to load. Maybe this can't be avoided but if we have an issue for it maybe someone will know why or how to speed it up. Seems suspiciously slow to me.

iotivity issue: https://jira.iotivity.org/browse/IOT-2717

@gabrielschulhof
Copy link

I think this may depend on your network setup, but in what way, I cannot say.

@johnandersen777
Copy link
Author

@gabrielschulhof Indeed, I'd assume it's some sort of timeout.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants