Closed IvanSanchez closed 5 years ago
Using 1 << 26
works well with order<=10. There is a speed-up but doesn't seem to be that big (~0.5%):
With Cantor's: Generated a 10-order icosphere (10485762 vertices / 20971520 triangles) in 11.020ms.
With 1 << 26: Generated a 10-order icosphere (10485762 vertices / 20971520 triangles) in 10.968ms.
(disclaimer: benchmark consists of 1 (one) data point)
That's within variance. So I'd rather keep Cantor's pairing function because I think it's cool :)
Change the pairing function from Cantor's to a 26-bit shift.