Commit cbea7ad
ARROW-11354: [Rust] Speed-up cast of dates and times (2-4x)
This PR improves the performance of certain time / date casts by using the brand new API proposed in #9235 .
That API allows for a very fast execution of unary and infalible operations on primitive arrays, and this PR leverages that for cast operations that require a simple mathematical operation.
```
Switched to branch 'fast_unary'
Compiling arrow v3.0.0-SNAPSHOT (/Users/jorgecarleitao/projects/arrow/rust/arrow)
Finished bench [optimized] target(s) in 1m 06s
Running /Users/jorgecarleitao/projects/arrow/rust/target/release/deps/cast_kernels-25ee76597a8b997b
Gnuplot not found, using plotters backend
cast date64 to date32 512
time: [1.1668 us 1.1706 us 1.1749 us]
change: [-83.347% -83.248% -83.144%] (p = 0.00 < 0.05)
Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
3 (3.00%) high mild
2 (2.00%) high severe
cast date32 to date64 512
time: [899.73 ns 930.58 ns 971.56 ns]
change: [-86.799% -86.520% -86.190%] (p = 0.00 < 0.05)
Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
3 (3.00%) high mild
7 (7.00%) high severe
cast time32s to time32ms 512
time: [728.73 ns 732.33 ns 735.90 ns]
change: [-54.503% -54.201% -53.917%] (p = 0.00 < 0.05)
Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) high mild
1 (1.00%) high severe
cast time64ns to time32s 512
time: [4.8374 us 4.8447 us 4.8526 us]
change: [-57.022% -56.791% -56.587%] (p = 0.00 < 0.05)
Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
6 (6.00%) high mild
2 (2.00%) high severe
```
Closes #9297 from jorgecarleitao/fast_unary
Authored-by: Jorge C. Leitao <jorgecarleitao@gmail.com>
Signed-off-by: Neville Dipale <nevilledips@gmail.com>1 parent 2696951 commit cbea7ad
3 files changed
+124
-61
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
569 | 570 | | |
570 | 571 | | |
571 | 572 | | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | 573 | | |
581 | | - | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
582 | 578 | | |
583 | 579 | | |
584 | 580 | | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | 581 | | |
594 | | - | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
595 | 587 | | |
596 | 588 | | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
| 589 | + | |
601 | 590 | | |
602 | | - | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
603 | 596 | | |
604 | 597 | | |
605 | | - | |
606 | | - | |
607 | | - | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
608 | 606 | | |
609 | | - | |
| 607 | + | |
610 | 608 | | |
| 609 | + | |
611 | 610 | | |
612 | 611 | | |
613 | 612 | | |
| |||
632 | 631 | | |
633 | 632 | | |
634 | 633 | | |
635 | | - | |
636 | | - | |
637 | | - | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
638 | 638 | | |
639 | | - | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
640 | 642 | | |
641 | 643 | | |
642 | | - | |
643 | | - | |
644 | | - | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
645 | 648 | | |
646 | | - | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
647 | 652 | | |
648 | 653 | | |
649 | 654 | | |
| |||
652 | 657 | | |
653 | 658 | | |
654 | 659 | | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
667 | 664 | | |
668 | 665 | | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
682 | 670 | | |
683 | 671 | | |
684 | 672 | | |
| |||
806 | 794 | | |
807 | 795 | | |
808 | 796 | | |
809 | | - | |
| 797 | + | |
810 | 798 | | |
811 | 799 | | |
812 | 800 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
0 commit comments