4 ms·
Some algorithms and data formats become couple times faster when appropriate bit manipulation instructions are used. Check this PR where I managed to substanti
by Const-me 6y ago
Some algorithms and data formats become couple times faster when appropriate bit manipulation instructions are used.
Check this PR where I managed to substantially speed up an open source library: https://github.com/AcademySoftwareFoundation/openvdb/pull/493 https://github.com/AcademySoftwareFoundation/openvdb/pull/49... That's just 3 instructions, bsr, bsf, and popcnt.
- cpach 6y agoCool! Quite interesting discussion in the PR.
- ncmncm 6y ago40% overall performance improvements are often welcomed.
- Const-me 6y agoThat OpenVDB data structure is a sparse hierarchical collection with a huge count of small 3D blocks of voxels. They use bit masks in the blocks to track which voxels are empty, and which contain the payload data or higher resolution child blocks. That’s why these bit manipulation instructions contributed that much to the overall performance of the library. I saw similar approach in other software as well. Not necessarily for voxels, also 2D data, and trees where nodes use bits to track children.
- ncmncm 6y agoBitmap representations are seriously underused throughout the software world. I am used to getting 10x performance improvements where they are first introduced. A popcount instruction often accounts for much of that.