highfidelity/hifi — pull request #2709 by ZappoMan (2014-04-21 23:58:09+00:00)
Title: Voxel/Particle Server Performance Improvements

This commit makes it possible for the Voxel server to handle several new load test scenarios and significantly higher load particularly in a massive "burst" client connection state.

The major improvement comes from eliminating calls to NodeList::getInstance()->nodeWithUUID() which requires locking of the node lists node hash. This is particularly problematic when nodes are connecting/disconnecting from the domain at a rapid rate.

The other major fix is to clean up memory management across the threads by properly using Qt Shared Pointers. Now the three main objects that depend on each other (OctreeSendThread, OctreeQueryNode, and OctreeServer) will have proper refcounted shared pointers to each other, which fixes several crashes that would occur in various connect/disconnect cases.

The follow load tests were run [https://github.com/highfidelity/hifi/wiki/Octree-Server-Scaling-Tests], and this build passes them all... (the old code would crash in each of these cases for various reasons).