First, since i’m new to this board: hi @ everyone
I’d like to ask you for some advice how to solve some scenegraph performance issues.
About two years i wrote a small visualisation plugin during an internship. It had to be written in java so i decided to code a very simple (and crude) scenegraph using jogl. Each inner node of the graph used a vector to store child nodes and Iterators to traverse them.
While i knew that wasn’t a very elegant solution it was enough to do the job since it was only going to be used for very small scenegraphs without any changes at the graph during rendertime.
Recently i got a call from the company about some performance problems with my plugin.
Looking into it i found that they started to use it for a lot bigger scenegraphs (20000+ nodes) and changed node parameters during the rendering process. I figured out two major problems:
- Changes at the scenegraph during rendering cause multiple ConcurrentModificationExceptions due to the Iterator usage.
(As a quick fix i replaced all Iterators with regular loops) - While node parameters like Color are changed often the node hierarchy of the graph stays the same at all time, therefore my original approach of using a different vector for each inner node is probably not the most efficient solution.
I’m now thinking of using a single list datastructure to store the scenegraph nodes preorder-sorted for a more efficient traversal.
Does anyone of you have experience with problems like this and can give me a few tips to further increase the performance?
TIA