Commit d45f846
perf: Optimize Morton order with hypercube and vectorization (#3708)
* perf: Skip bounds check for initial elements in 2^n hypercube
* lint:Use a list comprehension rather than a for loop
* pref:Add decode_morton_vectorized
* perf:Replace math.log2() with bit_length()
* perf:Use magic numbers for 2D and 3D
* perf:Add 4D Morton magic numbers
* perf:Add Morton magic numbers for 5D
* perf:Remove singleton dimensions to reduce ndims
* Add changes
* fix:Address type annotation and linting issues
* perf:Remove magic number functions
* test:Add power of 2 sharding indexing tests
* test: Add Morton order benchmarks with cache clearing
Add benchmarks that clear the _morton_order LRU cache before each
iteration to measure the full Morton computation cost:
- test_sharded_morton_indexing: 512-4096 chunks per shard
- test_sharded_morton_indexing_large: 32768 chunks per shard
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix:Bound LRU cache of _morton_order to 16
* test:Add a single chunk test for a large shard
* test:Add indexing benchmarks for writing
* tests:Add single chunk write test for sharding
* Update 3708.misc.md
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Davis Bennett <davis.v.bennett@gmail.com>1 parent 36caf1f commit d45f846
2 files changed
+91
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1452 | 1452 | | |
1453 | 1453 | | |
1454 | 1454 | | |
1455 | | - | |
| 1455 | + | |
1456 | 1456 | | |
1457 | 1457 | | |
1458 | 1458 | | |
| |||
1467 | 1467 | | |
1468 | 1468 | | |
1469 | 1469 | | |
1470 | | - | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
1471 | 1507 | | |
1472 | 1508 | | |
1473 | | - | |
1474 | | - | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
1475 | 1560 | | |
1476 | 1561 | | |
1477 | 1562 | | |
1478 | 1563 | | |
1479 | 1564 | | |
| 1565 | + | |
1480 | 1566 | | |
1481 | 1567 | | |
1482 | 1568 | | |
| |||
0 commit comments