Replace the loops in MathUtils.nextPowerOf2 by bit math
This is an O(1) implementation compared to the previous O(log n). In my tests it was faster for all values >4 (int) / >8 (long).
正在显示
请
注册
或者
登录
后发表评论
This is an O(1) implementation compared to the previous O(log n). In my tests it was faster for all values >4 (int) / >8 (long).