The octree construction is fast, as well as the traversal. The major bottlenecks are the VRAM usage (1 million bodies require ~1GB), which could be probably halved by reusing intermediate buffers, and the particle to leaf evaluation, which would benefit from more fp32 FLOPS. Moreover, I still don't have a good heuristic to predetermine the size of the BFS queue, perhaps some sort of memory paging could solve the issue.