[Interop-dev] GSoC 2017 netjsongraph.js progress report

Xiang Gao (spam-protected)
Thu Aug 10 12:32:46 CEST 2017


Hi, all

Last week I focus on how to improve performance of current dev version.

At first, I read a lot of articles like:

- http://www.ianww.com/blog/2012/11/04/optimizing-three-dot-js-performance-simulating-tens-of-thousands-of-independent-moving-objects/ <http://www.ianww.com/blog/2012/11/04/optimizing-three-dot-js-performance-simulating-tens-of-thousands-of-independent-moving-objects/>
- https://stackoverflow.com/questions/22028288/how-to-optimize-rendering-of-many-spheregeometry-in-three-js <https://stackoverflow.com/questions/22028288/how-to-optimize-rendering-of-many-spheregeometry-in-three-js>

and summarized three ways:

- reuse geometry and material
- combine the mesh
- use web worker

I have try to use first method by https://github.com/netjson/netjsongraph.js/commit/bb217902124b35ebba4336d9e52af8de2b3a8446 <https://github.com/netjson/netjsongraph.js/commit/bb217902124b35ebba4336d9e52af8de2b3a8446>
However, other two methods let me in trouble. First, our nodes and links are mutually independent and the position of them is dynamic, so I can not combine them into one. Second, I tried to use Web Worker follow the below articles in three place in my code: elements creation, position of elements calculation and tick called in static rendering, but they all failed. I discovered only data with no function can be posted into Web Worker, so the three.js geometry and d3 simulation can not be posted into Web Worker, so it can’t use Web Worker in these three place. I will find appropriate scene in the future.

- https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers <https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers>
- https://www.html5rocks.com/en/tutorials/workers/basics/ <https://www.html5rocks.com/en/tutorials/workers/basics/>
- https://github.com/mrdoob/three.js/blob/master/examples/raytracing_sandbox.html <https://github.com/mrdoob/three.js/blob/master/examples/raytracing_sandbox.html>

And there is anther problem is linewidth has no effect:  https://github.com/netjson/netjsongraph.js/issues/47 <https://github.com/netjson/netjsongraph.js/issues/47>

Current 1k nodes and 2k links can be rendering under 60 FPS, and 10k nodes still slow.


Next week I would fix #47 and continue to improve performance.


Best regards

Xiang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.funkfeuer.at/pipermail/interop-dev/attachments/20170810/8a977675/attachment.html>


More information about the Interop-dev mailing list