dhart performance & bottlenecks #33
Replies: 6 comments 34 replies
-
One concern is the time it takes to pass data from C# to the C interface. It may be helpful if you can try the two different methods of generating rays, one where you loop over the directions and one where you make two lists for directions and origins and don't iterate at all in c#. Another idea for trying to understand the performance is to generate all of the origins and the direction to be outside the model bounding box, each ray would instantly fail the occlusion test and wouldn't bother traversing the bvh. I think this might capture the data handling times in the interface. |
Beta Was this translation helpful? Give feedback.
-
it seems you are pretty capable on the C# side, so give me some time and I am going to clarify the build instructions so you can edit the c# interface and build the API. I'll still handle the embree interface, but this way you can test out any of these data conversion ideas quicker than posting on github :D |
Beta Was this translation helpful? Give feedback.
-
@mariuszhermansdorfer I made a hacked test branch for you. https://github.com/cadop/dhart/tree/support-for-stream-of-rays-in-embree You can take a look at the commits to see how its done, but the main points are:
I just copied the ray arrays, so its possible there is some other optimization going on (which is why it may be useful for you to test as end-to-end). If you follow the updated BUILD.MD instructions and install the DebugRelease config, there will be an out-install folder that has
|
Beta Was this translation helpful? Give feedback.
-
@mariuszhermansdorfer The graph generator is explained in detail https://arxiv.org/pdf/2101.10503.pdf (figure 9 is a decent summary). The gist is; pick a start point which is a valid location you want to create a grid from. It then does a breadth-first search of the environment to find the available edges in a grid. If there is something blocking the edge (like the wall of a building), it doesn't create it. You can also set things like max slopes and steps (i.e. if the slope is too high it won't create an edge or new node). |
Beta Was this translation helpful? Give feedback.
-
@mariuszhermansdorfer Parallelized Stream method is implemented on latest commit of the stream branch. I left the non-stream version with the 99999 flag for you to test again. Also please check that its giving the same results just in case there is a race condition. |
Beta Was this translation helpful? Give feedback.
-
I modified some parameters. Could you check running the same function with the following keys for max_distance:
One of them is giving me very good results, but I could have done something like "p-hacking". If it worked, it will be noticeable. |
Beta Was this translation helpful? Give feedback.
-
As mentioned in #29, let's discuss various performance improvements strategies for dhart.
Beta Was this translation helpful? Give feedback.
All reactions