更新libclamav库1.0.0版本

This commit is contained in:
2023-01-14 18:28:39 +08:00
parent b879ee0b2e
commit 45fe15f472
8531 changed files with 1222046 additions and 177272 deletions

View File

@@ -0,0 +1,168 @@
#![feature(test)]
extern crate rustfft;
extern crate test;
use paste::paste;
use rustfft::num_complex::Complex;
use rustfft::num_traits::Zero;
use rustfft::Fft;
use std::sync::Arc;
use test::Bencher;
// Make fft using planner
fn bench_planned_32(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerNeon::new().unwrap();
let fft: Arc<dyn Fft<f32>> = planner.plan_fft_forward(len);
let mut buffer: Vec<Complex<f32>> = vec![Complex::zero(); len];
let mut scratch: Vec<Complex<f32>> = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// Make fft using planner
fn bench_planned_64(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerNeon::new().unwrap();
let fft: Arc<dyn Fft<f64>> = planner.plan_fft_forward(len);
let mut buffer: Vec<Complex<f64>> = vec![Complex::zero(); len];
let mut scratch: Vec<Complex<f64>> = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// Create benches using functions taking one argument
macro_rules! make_benches {
($name:ident, $fname:ident, { $($len:literal),* }) => {
paste! {
$(
#[bench]
fn [<bench_ $name _f32_ $len>](b: &mut Bencher) {
[<bench_ $fname _32>](b, $len);
}
#[bench]
fn [<bench_ $name _f64_ $len>](b: &mut Bencher) {
[<bench_ $fname _64>](b, $len);
}
)*
}
}
}
make_benches!(from2to1024, planned, {2, 3, 4, 5, 6, 7, 8, 9 });
make_benches!(from2to1024, planned, {10, 11, 12, 13, 14, 15, 16, 17, 18, 19 });
make_benches!(from2to1024, planned, {20, 21, 22, 23, 24, 25, 26, 27, 28, 29 });
make_benches!(from2to1024, planned, {30, 31, 32, 33, 34, 35, 36, 37, 38, 39 });
make_benches!(from2to1024, planned, {40, 41, 42, 43, 44, 45, 46, 47, 48, 49 });
make_benches!(from2to1024, planned, {50, 51, 52, 53, 54, 55, 56, 57, 58, 59 });
make_benches!(from2to1024, planned, {60, 61, 62, 63, 64, 65, 66, 67, 68, 69 });
make_benches!(from2to1024, planned, {70, 71, 72, 73, 74, 75, 76, 77, 78, 79 });
make_benches!(from2to1024, planned, {80, 81, 82, 83, 84, 85, 86, 87, 88, 89 });
make_benches!(from2to1024, planned, {90, 91, 92, 93, 94, 95, 96, 97, 98, 99 });
make_benches!(from2to1024, planned, {100, 101, 102, 103, 104, 105, 106, 107, 108, 109 });
make_benches!(from2to1024, planned, {110, 111, 112, 113, 114, 115, 116, 117, 118, 119 });
make_benches!(from2to1024, planned, {120, 121, 122, 123, 124, 125, 126, 127, 128, 129 });
make_benches!(from2to1024, planned, {130, 131, 132, 133, 134, 135, 136, 137, 138, 139 });
make_benches!(from2to1024, planned, {140, 141, 142, 143, 144, 145, 146, 147, 148, 149 });
make_benches!(from2to1024, planned, {150, 151, 152, 153, 154, 155, 156, 157, 158, 159 });
make_benches!(from2to1024, planned, {160, 161, 162, 163, 164, 165, 166, 167, 168, 169 });
make_benches!(from2to1024, planned, {170, 171, 172, 173, 174, 175, 176, 177, 178, 179 });
make_benches!(from2to1024, planned, {180, 181, 182, 183, 184, 185, 186, 187, 188, 189 });
make_benches!(from2to1024, planned, {190, 191, 192, 193, 194, 195, 196, 197, 198, 199 });
/*
make_benches!(from2to1024, planned, {200, 201, 202, 203, 204, 205, 206, 207, 208, 209 });
make_benches!(from2to1024, planned, {210, 211, 212, 213, 214, 215, 216, 217, 218, 219 });
make_benches!(from2to1024, planned, {220, 221, 222, 223, 224, 225, 226, 227, 228, 229 });
make_benches!(from2to1024, planned, {230, 231, 232, 233, 234, 235, 236, 237, 238, 239 });
make_benches!(from2to1024, planned, {240, 241, 242, 243, 244, 245, 246, 247, 248, 249 });
make_benches!(from2to1024, planned, {250, 251, 252, 253, 254, 255, 256, 257, 258, 259 });
make_benches!(from2to1024, planned, {260, 261, 262, 263, 264, 265, 266, 267, 268, 269 });
make_benches!(from2to1024, planned, {270, 271, 272, 273, 274, 275, 276, 277, 278, 279 });
make_benches!(from2to1024, planned, {280, 281, 282, 283, 284, 285, 286, 287, 288, 289 });
make_benches!(from2to1024, planned, {290, 291, 292, 293, 294, 295, 296, 297, 298, 299 });
make_benches!(from2to1024, planned, {300, 301, 302, 303, 304, 305, 306, 307, 308, 309 });
make_benches!(from2to1024, planned, {310, 311, 312, 313, 314, 315, 316, 317, 318, 319 });
make_benches!(from2to1024, planned, {320, 321, 322, 323, 324, 325, 326, 327, 328, 329 });
make_benches!(from2to1024, planned, {330, 331, 332, 333, 334, 335, 336, 337, 338, 339 });
make_benches!(from2to1024, planned, {340, 341, 342, 343, 344, 345, 346, 347, 348, 349 });
make_benches!(from2to1024, planned, {350, 351, 352, 353, 354, 355, 356, 357, 358, 359 });
make_benches!(from2to1024, planned, {360, 361, 362, 363, 364, 365, 366, 367, 368, 369 });
make_benches!(from2to1024, planned, {370, 371, 372, 373, 374, 375, 376, 377, 378, 379 });
make_benches!(from2to1024, planned, {380, 381, 382, 383, 384, 385, 386, 387, 388, 389 });
make_benches!(from2to1024, planned, {390, 391, 392, 393, 394, 395, 396, 397, 398, 399 });
make_benches!(from2to1024, planned, {400, 401, 402, 403, 404, 405, 406, 407, 408, 409 });
make_benches!(from2to1024, planned, {410, 411, 412, 413, 414, 415, 416, 417, 418, 419 });
make_benches!(from2to1024, planned, {420, 421, 422, 423, 424, 425, 426, 427, 428, 429 });
make_benches!(from2to1024, planned, {430, 431, 432, 433, 434, 435, 436, 437, 438, 439 });
make_benches!(from2to1024, planned, {440, 441, 442, 443, 444, 445, 446, 447, 448, 449 });
make_benches!(from2to1024, planned, {450, 451, 452, 453, 454, 455, 456, 457, 458, 459 });
make_benches!(from2to1024, planned, {460, 461, 462, 463, 464, 465, 466, 467, 468, 469 });
make_benches!(from2to1024, planned, {470, 471, 472, 473, 474, 475, 476, 477, 478, 479 });
make_benches!(from2to1024, planned, {480, 481, 482, 483, 484, 485, 486, 487, 488, 489 });
make_benches!(from2to1024, planned, {490, 491, 492, 493, 494, 495, 496, 497, 498, 499 });
make_benches!(from2to1024, planned, {500, 501, 502, 503, 504, 505, 506, 507, 508, 509 });
make_benches!(from2to1024, planned, {510, 511, 512, 513, 514, 515, 516, 517, 518, 519 });
make_benches!(from2to1024, planned, {520, 521, 522, 523, 524, 525, 526, 527, 528, 529 });
make_benches!(from2to1024, planned, {530, 531, 532, 533, 534, 535, 536, 537, 538, 539 });
make_benches!(from2to1024, planned, {540, 541, 542, 543, 544, 545, 546, 547, 548, 549 });
make_benches!(from2to1024, planned, {550, 551, 552, 553, 554, 555, 556, 557, 558, 559 });
make_benches!(from2to1024, planned, {560, 561, 562, 563, 564, 565, 566, 567, 568, 569 });
make_benches!(from2to1024, planned, {570, 571, 572, 573, 574, 575, 576, 577, 578, 579 });
make_benches!(from2to1024, planned, {580, 581, 582, 583, 584, 585, 586, 587, 588, 589 });
make_benches!(from2to1024, planned, {590, 591, 592, 593, 594, 595, 596, 597, 598, 599 });
make_benches!(from2to1024, planned, {600, 601, 602, 603, 604, 605, 606, 607, 608, 609 });
make_benches!(from2to1024, planned, {610, 611, 612, 613, 614, 615, 616, 617, 618, 619 });
make_benches!(from2to1024, planned, {620, 621, 622, 623, 624, 625, 626, 627, 628, 629 });
make_benches!(from2to1024, planned, {630, 631, 632, 633, 634, 635, 636, 637, 638, 639 });
make_benches!(from2to1024, planned, {640, 641, 642, 643, 644, 645, 646, 647, 648, 649 });
make_benches!(from2to1024, planned, {650, 651, 652, 653, 654, 655, 656, 657, 658, 659 });
make_benches!(from2to1024, planned, {660, 661, 662, 663, 664, 665, 666, 667, 668, 669 });
make_benches!(from2to1024, planned, {670, 671, 672, 673, 674, 675, 676, 677, 678, 679 });
make_benches!(from2to1024, planned, {680, 681, 682, 683, 684, 685, 686, 687, 688, 689 });
make_benches!(from2to1024, planned, {690, 691, 692, 693, 694, 695, 696, 697, 698, 699 });
make_benches!(from2to1024, planned, {700, 701, 702, 703, 704, 705, 706, 707, 708, 709 });
make_benches!(from2to1024, planned, {710, 711, 712, 713, 714, 715, 716, 717, 718, 719 });
make_benches!(from2to1024, planned, {720, 721, 722, 723, 724, 725, 726, 727, 728, 729 });
make_benches!(from2to1024, planned, {730, 731, 732, 733, 734, 735, 736, 737, 738, 739 });
make_benches!(from2to1024, planned, {740, 741, 742, 743, 744, 745, 746, 747, 748, 749 });
make_benches!(from2to1024, planned, {750, 751, 752, 753, 754, 755, 756, 757, 758, 759 });
make_benches!(from2to1024, planned, {760, 761, 762, 763, 764, 765, 766, 767, 768, 769 });
make_benches!(from2to1024, planned, {770, 771, 772, 773, 774, 775, 776, 777, 778, 779 });
make_benches!(from2to1024, planned, {780, 781, 782, 783, 784, 785, 786, 787, 788, 789 });
make_benches!(from2to1024, planned, {790, 791, 792, 793, 794, 795, 796, 797, 798, 799 });
make_benches!(from2to1024, planned, {800, 801, 802, 803, 804, 805, 806, 807, 808, 809 });
make_benches!(from2to1024, planned, {810, 811, 812, 813, 814, 815, 816, 817, 818, 819 });
make_benches!(from2to1024, planned, {820, 821, 822, 823, 824, 825, 826, 827, 828, 829 });
make_benches!(from2to1024, planned, {830, 831, 832, 833, 834, 835, 836, 837, 838, 839 });
make_benches!(from2to1024, planned, {840, 841, 842, 843, 844, 845, 846, 847, 848, 849 });
make_benches!(from2to1024, planned, {850, 851, 852, 853, 854, 855, 856, 857, 858, 859 });
make_benches!(from2to1024, planned, {860, 861, 862, 863, 864, 865, 866, 867, 868, 869 });
make_benches!(from2to1024, planned, {870, 871, 872, 873, 874, 875, 876, 877, 878, 879 });
make_benches!(from2to1024, planned, {880, 881, 882, 883, 884, 885, 886, 887, 888, 889 });
make_benches!(from2to1024, planned, {890, 891, 892, 893, 894, 895, 896, 897, 898, 899 });
make_benches!(from2to1024, planned, {900, 901, 902, 903, 904, 905, 906, 907, 908, 909 });
make_benches!(from2to1024, planned, {910, 911, 912, 913, 914, 915, 916, 917, 918, 919 });
make_benches!(from2to1024, planned, {920, 921, 922, 923, 924, 925, 926, 927, 928, 929 });
make_benches!(from2to1024, planned, {930, 931, 932, 933, 934, 935, 936, 937, 938, 939 });
make_benches!(from2to1024, planned, {940, 941, 942, 943, 944, 945, 946, 947, 948, 949 });
make_benches!(from2to1024, planned, {950, 951, 952, 953, 954, 955, 956, 957, 958, 959 });
make_benches!(from2to1024, planned, {960, 961, 962, 963, 964, 965, 966, 967, 968, 969 });
make_benches!(from2to1024, planned, {970, 971, 972, 973, 974, 975, 976, 977, 978, 979 });
make_benches!(from2to1024, planned, {980, 981, 982, 983, 984, 985, 986, 987, 988, 989 });
make_benches!(from2to1024, planned, {990, 991, 992, 993, 994, 995, 996, 997, 998, 999 });
make_benches!(from2to1024, planned, {1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009 });
make_benches!(from2to1024, planned, {1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019 });
make_benches!(from2to1024, planned, {1020, 1021, 1022, 1023, 1024 });
*/

View File

@@ -0,0 +1,193 @@
#![feature(test)]
extern crate rustfft;
extern crate test;
use paste::paste;
use rustfft::num_complex::Complex;
use rustfft::num_traits::Zero;
use rustfft::{Fft, FftDirection};
use std::sync::Arc;
use test::Bencher;
// Make fft using planner
fn bench_planned_32(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerScalar::new();
let fft: Arc<dyn Fft<f32>> = planner.plan_fft_forward(len);
let mut buffer: Vec<Complex<f32>> = vec![Complex::zero(); len];
let mut scratch: Vec<Complex<f32>> = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// Make fft using planner
fn bench_planned_64(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerScalar::new();
let fft: Arc<dyn Fft<f64>> = planner.plan_fft_forward(len);
let mut buffer: Vec<Complex<f64>> = vec![Complex::zero(); len];
let mut scratch: Vec<Complex<f64>> = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// Create benches using functions taking one argument
macro_rules! make_benches {
($name:ident, $fname:ident, { $($len:literal),* }) => {
paste! {
$(
#[bench]
fn [<bench_ $name _f32_ $len>](b: &mut Bencher) {
[<bench_ $fname _32>](b, $len);
}
#[bench]
fn [<bench_ $name _f64_ $len>](b: &mut Bencher) {
[<bench_ $fname _64>](b, $len);
}
)*
}
}
}
make_benches!(from2to1024, planned, {2, 3, 4, 5, 6, 7, 8, 9 });
make_benches!(from2to1024, planned, {10, 11, 12, 13, 14, 15, 16, 17, 18, 19 });
make_benches!(from2to1024, planned, {20, 21, 22, 23, 24, 25, 26, 27, 28, 29 });
make_benches!(from2to1024, planned, {30, 31, 32, 33, 34, 35, 36, 37, 38, 39 });
make_benches!(from2to1024, planned, {40, 41, 42, 43, 44, 45, 46, 47, 48, 49 });
make_benches!(from2to1024, planned, {50, 51, 52, 53, 54, 55, 56, 57, 58, 59 });
make_benches!(from2to1024, planned, {60, 61, 62, 63, 64, 65, 66, 67, 68, 69 });
make_benches!(from2to1024, planned, {70, 71, 72, 73, 74, 75, 76, 77, 78, 79 });
make_benches!(from2to1024, planned, {80, 81, 82, 83, 84, 85, 86, 87, 88, 89 });
make_benches!(from2to1024, planned, {90, 91, 92, 93, 94, 95, 96, 97, 98, 99 });
make_benches!(from2to1024, planned, {100, 101, 102, 103, 104, 105, 106, 107, 108, 109 });
make_benches!(from2to1024, planned, {110, 111, 112, 113, 114, 115, 116, 117, 118, 119 });
make_benches!(from2to1024, planned, {120, 121, 122, 123, 124, 125, 126, 127, 128, 129 });
make_benches!(from2to1024, planned, {130, 131, 132, 133, 134, 135, 136, 137, 138, 139 });
make_benches!(from2to1024, planned, {140, 141, 142, 143, 144, 145, 146, 147, 148, 149 });
make_benches!(from2to1024, planned, {150, 151, 152, 153, 154, 155, 156, 157, 158, 159 });
make_benches!(from2to1024, planned, {160, 161, 162, 163, 164, 165, 166, 167, 168, 169 });
make_benches!(from2to1024, planned, {170, 171, 172, 173, 174, 175, 176, 177, 178, 179 });
make_benches!(from2to1024, planned, {180, 181, 182, 183, 184, 185, 186, 187, 188, 189 });
make_benches!(from2to1024, planned, {190, 191, 192, 193, 194, 195, 196, 197, 198, 199 });
/*
make_benches!(from2to1024, planned, {200, 201, 202, 203, 204, 205, 206, 207, 208, 209 });
make_benches!(from2to1024, planned, {210, 211, 212, 213, 214, 215, 216, 217, 218, 219 });
make_benches!(from2to1024, planned, {220, 221, 222, 223, 224, 225, 226, 227, 228, 229 });
make_benches!(from2to1024, planned, {230, 231, 232, 233, 234, 235, 236, 237, 238, 239 });
make_benches!(from2to1024, planned, {240, 241, 242, 243, 244, 245, 246, 247, 248, 249 });
make_benches!(from2to1024, planned, {250, 251, 252, 253, 254, 255, 256, 257, 258, 259 });
make_benches!(from2to1024, planned, {260, 261, 262, 263, 264, 265, 266, 267, 268, 269 });
make_benches!(from2to1024, planned, {270, 271, 272, 273, 274, 275, 276, 277, 278, 279 });
make_benches!(from2to1024, planned, {280, 281, 282, 283, 284, 285, 286, 287, 288, 289 });
make_benches!(from2to1024, planned, {290, 291, 292, 293, 294, 295, 296, 297, 298, 299 });
make_benches!(from2to1024, planned, {300, 301, 302, 303, 304, 305, 306, 307, 308, 309 });
make_benches!(from2to1024, planned, {310, 311, 312, 313, 314, 315, 316, 317, 318, 319 });
make_benches!(from2to1024, planned, {320, 321, 322, 323, 324, 325, 326, 327, 328, 329 });
make_benches!(from2to1024, planned, {330, 331, 332, 333, 334, 335, 336, 337, 338, 339 });
make_benches!(from2to1024, planned, {340, 341, 342, 343, 344, 345, 346, 347, 348, 349 });
make_benches!(from2to1024, planned, {350, 351, 352, 353, 354, 355, 356, 357, 358, 359 });
make_benches!(from2to1024, planned, {360, 361, 362, 363, 364, 365, 366, 367, 368, 369 });
make_benches!(from2to1024, planned, {370, 371, 372, 373, 374, 375, 376, 377, 378, 379 });
make_benches!(from2to1024, planned, {380, 381, 382, 383, 384, 385, 386, 387, 388, 389 });
make_benches!(from2to1024, planned, {390, 391, 392, 393, 394, 395, 396, 397, 398, 399 });
make_benches!(from2to1024, planned, {400, 401, 402, 403, 404, 405, 406, 407, 408, 409 });
make_benches!(from2to1024, planned, {410, 411, 412, 413, 414, 415, 416, 417, 418, 419 });
make_benches!(from2to1024, planned, {420, 421, 422, 423, 424, 425, 426, 427, 428, 429 });
make_benches!(from2to1024, planned, {430, 431, 432, 433, 434, 435, 436, 437, 438, 439 });
make_benches!(from2to1024, planned, {440, 441, 442, 443, 444, 445, 446, 447, 448, 449 });
make_benches!(from2to1024, planned, {450, 451, 452, 453, 454, 455, 456, 457, 458, 459 });
make_benches!(from2to1024, planned, {460, 461, 462, 463, 464, 465, 466, 467, 468, 469 });
make_benches!(from2to1024, planned, {470, 471, 472, 473, 474, 475, 476, 477, 478, 479 });
make_benches!(from2to1024, planned, {480, 481, 482, 483, 484, 485, 486, 487, 488, 489 });
make_benches!(from2to1024, planned, {490, 491, 492, 493, 494, 495, 496, 497, 498, 499 });
make_benches!(from2to1024, planned, {500, 501, 502, 503, 504, 505, 506, 507, 508, 509 });
make_benches!(from2to1024, planned, {510, 511, 512, 513, 514, 515, 516, 517, 518, 519 });
make_benches!(from2to1024, planned, {520, 521, 522, 523, 524, 525, 526, 527, 528, 529 });
make_benches!(from2to1024, planned, {530, 531, 532, 533, 534, 535, 536, 537, 538, 539 });
make_benches!(from2to1024, planned, {540, 541, 542, 543, 544, 545, 546, 547, 548, 549 });
make_benches!(from2to1024, planned, {550, 551, 552, 553, 554, 555, 556, 557, 558, 559 });
make_benches!(from2to1024, planned, {560, 561, 562, 563, 564, 565, 566, 567, 568, 569 });
make_benches!(from2to1024, planned, {570, 571, 572, 573, 574, 575, 576, 577, 578, 579 });
make_benches!(from2to1024, planned, {580, 581, 582, 583, 584, 585, 586, 587, 588, 589 });
make_benches!(from2to1024, planned, {590, 591, 592, 593, 594, 595, 596, 597, 598, 599 });
make_benches!(from2to1024, planned, {600, 601, 602, 603, 604, 605, 606, 607, 608, 609 });
make_benches!(from2to1024, planned, {610, 611, 612, 613, 614, 615, 616, 617, 618, 619 });
make_benches!(from2to1024, planned, {620, 621, 622, 623, 624, 625, 626, 627, 628, 629 });
make_benches!(from2to1024, planned, {630, 631, 632, 633, 634, 635, 636, 637, 638, 639 });
make_benches!(from2to1024, planned, {640, 641, 642, 643, 644, 645, 646, 647, 648, 649 });
make_benches!(from2to1024, planned, {650, 651, 652, 653, 654, 655, 656, 657, 658, 659 });
make_benches!(from2to1024, planned, {660, 661, 662, 663, 664, 665, 666, 667, 668, 669 });
make_benches!(from2to1024, planned, {670, 671, 672, 673, 674, 675, 676, 677, 678, 679 });
make_benches!(from2to1024, planned, {680, 681, 682, 683, 684, 685, 686, 687, 688, 689 });
make_benches!(from2to1024, planned, {690, 691, 692, 693, 694, 695, 696, 697, 698, 699 });
make_benches!(from2to1024, planned, {700, 701, 702, 703, 704, 705, 706, 707, 708, 709 });
make_benches!(from2to1024, planned, {710, 711, 712, 713, 714, 715, 716, 717, 718, 719 });
make_benches!(from2to1024, planned, {720, 721, 722, 723, 724, 725, 726, 727, 728, 729 });
make_benches!(from2to1024, planned, {730, 731, 732, 733, 734, 735, 736, 737, 738, 739 });
make_benches!(from2to1024, planned, {740, 741, 742, 743, 744, 745, 746, 747, 748, 749 });
make_benches!(from2to1024, planned, {750, 751, 752, 753, 754, 755, 756, 757, 758, 759 });
make_benches!(from2to1024, planned, {760, 761, 762, 763, 764, 765, 766, 767, 768, 769 });
make_benches!(from2to1024, planned, {770, 771, 772, 773, 774, 775, 776, 777, 778, 779 });
make_benches!(from2to1024, planned, {780, 781, 782, 783, 784, 785, 786, 787, 788, 789 });
make_benches!(from2to1024, planned, {790, 791, 792, 793, 794, 795, 796, 797, 798, 799 });
make_benches!(from2to1024, planned, {800, 801, 802, 803, 804, 805, 806, 807, 808, 809 });
make_benches!(from2to1024, planned, {810, 811, 812, 813, 814, 815, 816, 817, 818, 819 });
make_benches!(from2to1024, planned, {820, 821, 822, 823, 824, 825, 826, 827, 828, 829 });
make_benches!(from2to1024, planned, {830, 831, 832, 833, 834, 835, 836, 837, 838, 839 });
make_benches!(from2to1024, planned, {840, 841, 842, 843, 844, 845, 846, 847, 848, 849 });
make_benches!(from2to1024, planned, {850, 851, 852, 853, 854, 855, 856, 857, 858, 859 });
make_benches!(from2to1024, planned, {860, 861, 862, 863, 864, 865, 866, 867, 868, 869 });
make_benches!(from2to1024, planned, {870, 871, 872, 873, 874, 875, 876, 877, 878, 879 });
make_benches!(from2to1024, planned, {880, 881, 882, 883, 884, 885, 886, 887, 888, 889 });
make_benches!(from2to1024, planned, {890, 891, 892, 893, 894, 895, 896, 897, 898, 899 });
make_benches!(from2to1024, planned, {900, 901, 902, 903, 904, 905, 906, 907, 908, 909 });
make_benches!(from2to1024, planned, {910, 911, 912, 913, 914, 915, 916, 917, 918, 919 });
make_benches!(from2to1024, planned, {920, 921, 922, 923, 924, 925, 926, 927, 928, 929 });
make_benches!(from2to1024, planned, {930, 931, 932, 933, 934, 935, 936, 937, 938, 939 });
make_benches!(from2to1024, planned, {940, 941, 942, 943, 944, 945, 946, 947, 948, 949 });
make_benches!(from2to1024, planned, {950, 951, 952, 953, 954, 955, 956, 957, 958, 959 });
make_benches!(from2to1024, planned, {960, 961, 962, 963, 964, 965, 966, 967, 968, 969 });
make_benches!(from2to1024, planned, {970, 971, 972, 973, 974, 975, 976, 977, 978, 979 });
make_benches!(from2to1024, planned, {980, 981, 982, 983, 984, 985, 986, 987, 988, 989 });
make_benches!(from2to1024, planned, {990, 991, 992, 993, 994, 995, 996, 997, 998, 999 });
make_benches!(from2to1024, planned, {1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009 });
make_benches!(from2to1024, planned, {1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019 });
make_benches!(from2to1024, planned, {1020, 1021, 1022, 1023, 1024 });
*/
make_benches!(power3_planned_scalar, planned, {0000003, 0000009, 0000027, 0000081, 0000243, 0000729, 0002187, 0006561, 0019683, 0059049, 0177147, 0531441, 1594323, 4782969 });
fn bench_radix3_32(b: &mut Bencher, len: usize) {
let fft: Arc<dyn Fft<f32>> =
Arc::new(rustfft::algorithm::Radix3::new(len, FftDirection::Forward));
let mut buffer: Vec<Complex<f32>> = vec![Complex::zero(); len];
let mut scratch: Vec<Complex<f32>> = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
fn bench_radix3_64(b: &mut Bencher, len: usize) {
let fft: Arc<dyn Fft<f32>> =
Arc::new(rustfft::algorithm::Radix3::new(len, FftDirection::Forward));
let mut buffer: Vec<Complex<f32>> = vec![Complex::zero(); len];
let mut scratch: Vec<Complex<f32>> = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
make_benches!(power3_radix3_scalar, radix3, {0000003, 0000009, 0000027, 0000081, 0000243, 0000729, 0002187, 0006561, 0019683, 0059049, 0177147, 0531441, 1594323, 4782969 });

View File

@@ -0,0 +1,168 @@
#![feature(test)]
extern crate rustfft;
extern crate test;
use paste::paste;
use rustfft::num_complex::Complex;
use rustfft::num_traits::Zero;
use rustfft::Fft;
use std::sync::Arc;
use test::Bencher;
// Make fft using planner
fn bench_planned_32(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerSse::new().unwrap();
let fft: Arc<dyn Fft<f32>> = planner.plan_fft_forward(len);
let mut buffer: Vec<Complex<f32>> = vec![Complex::zero(); len];
let mut scratch: Vec<Complex<f32>> = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// Make fft using planner
fn bench_planned_64(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerSse::new().unwrap();
let fft: Arc<dyn Fft<f64>> = planner.plan_fft_forward(len);
let mut buffer: Vec<Complex<f64>> = vec![Complex::zero(); len];
let mut scratch: Vec<Complex<f64>> = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// Create benches using functions taking one argument
macro_rules! make_benches {
($name:ident, $fname:ident, { $($len:literal),* }) => {
paste! {
$(
#[bench]
fn [<bench_ $name _f32_ $len>](b: &mut Bencher) {
[<bench_ $fname _32>](b, $len);
}
#[bench]
fn [<bench_ $name _f64_ $len>](b: &mut Bencher) {
[<bench_ $fname _64>](b, $len);
}
)*
}
}
}
make_benches!(from2to1024, planned, {2, 3, 4, 5, 6, 7, 8, 9 });
make_benches!(from2to1024, planned, {10, 11, 12, 13, 14, 15, 16, 17, 18, 19 });
make_benches!(from2to1024, planned, {20, 21, 22, 23, 24, 25, 26, 27, 28, 29 });
make_benches!(from2to1024, planned, {30, 31, 32, 33, 34, 35, 36, 37, 38, 39 });
make_benches!(from2to1024, planned, {40, 41, 42, 43, 44, 45, 46, 47, 48, 49 });
make_benches!(from2to1024, planned, {50, 51, 52, 53, 54, 55, 56, 57, 58, 59 });
make_benches!(from2to1024, planned, {60, 61, 62, 63, 64, 65, 66, 67, 68, 69 });
make_benches!(from2to1024, planned, {70, 71, 72, 73, 74, 75, 76, 77, 78, 79 });
make_benches!(from2to1024, planned, {80, 81, 82, 83, 84, 85, 86, 87, 88, 89 });
make_benches!(from2to1024, planned, {90, 91, 92, 93, 94, 95, 96, 97, 98, 99 });
make_benches!(from2to1024, planned, {100, 101, 102, 103, 104, 105, 106, 107, 108, 109 });
make_benches!(from2to1024, planned, {110, 111, 112, 113, 114, 115, 116, 117, 118, 119 });
make_benches!(from2to1024, planned, {120, 121, 122, 123, 124, 125, 126, 127, 128, 129 });
make_benches!(from2to1024, planned, {130, 131, 132, 133, 134, 135, 136, 137, 138, 139 });
make_benches!(from2to1024, planned, {140, 141, 142, 143, 144, 145, 146, 147, 148, 149 });
make_benches!(from2to1024, planned, {150, 151, 152, 153, 154, 155, 156, 157, 158, 159 });
make_benches!(from2to1024, planned, {160, 161, 162, 163, 164, 165, 166, 167, 168, 169 });
make_benches!(from2to1024, planned, {170, 171, 172, 173, 174, 175, 176, 177, 178, 179 });
make_benches!(from2to1024, planned, {180, 181, 182, 183, 184, 185, 186, 187, 188, 189 });
make_benches!(from2to1024, planned, {190, 191, 192, 193, 194, 195, 196, 197, 198, 199 });
/*
make_benches!(from2to1024, planned, {200, 201, 202, 203, 204, 205, 206, 207, 208, 209 });
make_benches!(from2to1024, planned, {210, 211, 212, 213, 214, 215, 216, 217, 218, 219 });
make_benches!(from2to1024, planned, {220, 221, 222, 223, 224, 225, 226, 227, 228, 229 });
make_benches!(from2to1024, planned, {230, 231, 232, 233, 234, 235, 236, 237, 238, 239 });
make_benches!(from2to1024, planned, {240, 241, 242, 243, 244, 245, 246, 247, 248, 249 });
make_benches!(from2to1024, planned, {250, 251, 252, 253, 254, 255, 256, 257, 258, 259 });
make_benches!(from2to1024, planned, {260, 261, 262, 263, 264, 265, 266, 267, 268, 269 });
make_benches!(from2to1024, planned, {270, 271, 272, 273, 274, 275, 276, 277, 278, 279 });
make_benches!(from2to1024, planned, {280, 281, 282, 283, 284, 285, 286, 287, 288, 289 });
make_benches!(from2to1024, planned, {290, 291, 292, 293, 294, 295, 296, 297, 298, 299 });
make_benches!(from2to1024, planned, {300, 301, 302, 303, 304, 305, 306, 307, 308, 309 });
make_benches!(from2to1024, planned, {310, 311, 312, 313, 314, 315, 316, 317, 318, 319 });
make_benches!(from2to1024, planned, {320, 321, 322, 323, 324, 325, 326, 327, 328, 329 });
make_benches!(from2to1024, planned, {330, 331, 332, 333, 334, 335, 336, 337, 338, 339 });
make_benches!(from2to1024, planned, {340, 341, 342, 343, 344, 345, 346, 347, 348, 349 });
make_benches!(from2to1024, planned, {350, 351, 352, 353, 354, 355, 356, 357, 358, 359 });
make_benches!(from2to1024, planned, {360, 361, 362, 363, 364, 365, 366, 367, 368, 369 });
make_benches!(from2to1024, planned, {370, 371, 372, 373, 374, 375, 376, 377, 378, 379 });
make_benches!(from2to1024, planned, {380, 381, 382, 383, 384, 385, 386, 387, 388, 389 });
make_benches!(from2to1024, planned, {390, 391, 392, 393, 394, 395, 396, 397, 398, 399 });
make_benches!(from2to1024, planned, {400, 401, 402, 403, 404, 405, 406, 407, 408, 409 });
make_benches!(from2to1024, planned, {410, 411, 412, 413, 414, 415, 416, 417, 418, 419 });
make_benches!(from2to1024, planned, {420, 421, 422, 423, 424, 425, 426, 427, 428, 429 });
make_benches!(from2to1024, planned, {430, 431, 432, 433, 434, 435, 436, 437, 438, 439 });
make_benches!(from2to1024, planned, {440, 441, 442, 443, 444, 445, 446, 447, 448, 449 });
make_benches!(from2to1024, planned, {450, 451, 452, 453, 454, 455, 456, 457, 458, 459 });
make_benches!(from2to1024, planned, {460, 461, 462, 463, 464, 465, 466, 467, 468, 469 });
make_benches!(from2to1024, planned, {470, 471, 472, 473, 474, 475, 476, 477, 478, 479 });
make_benches!(from2to1024, planned, {480, 481, 482, 483, 484, 485, 486, 487, 488, 489 });
make_benches!(from2to1024, planned, {490, 491, 492, 493, 494, 495, 496, 497, 498, 499 });
make_benches!(from2to1024, planned, {500, 501, 502, 503, 504, 505, 506, 507, 508, 509 });
make_benches!(from2to1024, planned, {510, 511, 512, 513, 514, 515, 516, 517, 518, 519 });
make_benches!(from2to1024, planned, {520, 521, 522, 523, 524, 525, 526, 527, 528, 529 });
make_benches!(from2to1024, planned, {530, 531, 532, 533, 534, 535, 536, 537, 538, 539 });
make_benches!(from2to1024, planned, {540, 541, 542, 543, 544, 545, 546, 547, 548, 549 });
make_benches!(from2to1024, planned, {550, 551, 552, 553, 554, 555, 556, 557, 558, 559 });
make_benches!(from2to1024, planned, {560, 561, 562, 563, 564, 565, 566, 567, 568, 569 });
make_benches!(from2to1024, planned, {570, 571, 572, 573, 574, 575, 576, 577, 578, 579 });
make_benches!(from2to1024, planned, {580, 581, 582, 583, 584, 585, 586, 587, 588, 589 });
make_benches!(from2to1024, planned, {590, 591, 592, 593, 594, 595, 596, 597, 598, 599 });
make_benches!(from2to1024, planned, {600, 601, 602, 603, 604, 605, 606, 607, 608, 609 });
make_benches!(from2to1024, planned, {610, 611, 612, 613, 614, 615, 616, 617, 618, 619 });
make_benches!(from2to1024, planned, {620, 621, 622, 623, 624, 625, 626, 627, 628, 629 });
make_benches!(from2to1024, planned, {630, 631, 632, 633, 634, 635, 636, 637, 638, 639 });
make_benches!(from2to1024, planned, {640, 641, 642, 643, 644, 645, 646, 647, 648, 649 });
make_benches!(from2to1024, planned, {650, 651, 652, 653, 654, 655, 656, 657, 658, 659 });
make_benches!(from2to1024, planned, {660, 661, 662, 663, 664, 665, 666, 667, 668, 669 });
make_benches!(from2to1024, planned, {670, 671, 672, 673, 674, 675, 676, 677, 678, 679 });
make_benches!(from2to1024, planned, {680, 681, 682, 683, 684, 685, 686, 687, 688, 689 });
make_benches!(from2to1024, planned, {690, 691, 692, 693, 694, 695, 696, 697, 698, 699 });
make_benches!(from2to1024, planned, {700, 701, 702, 703, 704, 705, 706, 707, 708, 709 });
make_benches!(from2to1024, planned, {710, 711, 712, 713, 714, 715, 716, 717, 718, 719 });
make_benches!(from2to1024, planned, {720, 721, 722, 723, 724, 725, 726, 727, 728, 729 });
make_benches!(from2to1024, planned, {730, 731, 732, 733, 734, 735, 736, 737, 738, 739 });
make_benches!(from2to1024, planned, {740, 741, 742, 743, 744, 745, 746, 747, 748, 749 });
make_benches!(from2to1024, planned, {750, 751, 752, 753, 754, 755, 756, 757, 758, 759 });
make_benches!(from2to1024, planned, {760, 761, 762, 763, 764, 765, 766, 767, 768, 769 });
make_benches!(from2to1024, planned, {770, 771, 772, 773, 774, 775, 776, 777, 778, 779 });
make_benches!(from2to1024, planned, {780, 781, 782, 783, 784, 785, 786, 787, 788, 789 });
make_benches!(from2to1024, planned, {790, 791, 792, 793, 794, 795, 796, 797, 798, 799 });
make_benches!(from2to1024, planned, {800, 801, 802, 803, 804, 805, 806, 807, 808, 809 });
make_benches!(from2to1024, planned, {810, 811, 812, 813, 814, 815, 816, 817, 818, 819 });
make_benches!(from2to1024, planned, {820, 821, 822, 823, 824, 825, 826, 827, 828, 829 });
make_benches!(from2to1024, planned, {830, 831, 832, 833, 834, 835, 836, 837, 838, 839 });
make_benches!(from2to1024, planned, {840, 841, 842, 843, 844, 845, 846, 847, 848, 849 });
make_benches!(from2to1024, planned, {850, 851, 852, 853, 854, 855, 856, 857, 858, 859 });
make_benches!(from2to1024, planned, {860, 861, 862, 863, 864, 865, 866, 867, 868, 869 });
make_benches!(from2to1024, planned, {870, 871, 872, 873, 874, 875, 876, 877, 878, 879 });
make_benches!(from2to1024, planned, {880, 881, 882, 883, 884, 885, 886, 887, 888, 889 });
make_benches!(from2to1024, planned, {890, 891, 892, 893, 894, 895, 896, 897, 898, 899 });
make_benches!(from2to1024, planned, {900, 901, 902, 903, 904, 905, 906, 907, 908, 909 });
make_benches!(from2to1024, planned, {910, 911, 912, 913, 914, 915, 916, 917, 918, 919 });
make_benches!(from2to1024, planned, {920, 921, 922, 923, 924, 925, 926, 927, 928, 929 });
make_benches!(from2to1024, planned, {930, 931, 932, 933, 934, 935, 936, 937, 938, 939 });
make_benches!(from2to1024, planned, {940, 941, 942, 943, 944, 945, 946, 947, 948, 949 });
make_benches!(from2to1024, planned, {950, 951, 952, 953, 954, 955, 956, 957, 958, 959 });
make_benches!(from2to1024, planned, {960, 961, 962, 963, 964, 965, 966, 967, 968, 969 });
make_benches!(from2to1024, planned, {970, 971, 972, 973, 974, 975, 976, 977, 978, 979 });
make_benches!(from2to1024, planned, {980, 981, 982, 983, 984, 985, 986, 987, 988, 989 });
make_benches!(from2to1024, planned, {990, 991, 992, 993, 994, 995, 996, 997, 998, 999 });
make_benches!(from2to1024, planned, {1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009 });
make_benches!(from2to1024, planned, {1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019 });
make_benches!(from2to1024, planned, {1020, 1021, 1022, 1023, 1024 });
*/

View File

@@ -0,0 +1,91 @@
#![feature(test)]
extern crate rustfft;
extern crate test;
use paste::paste;
use rustfft::num_complex::Complex;
use rustfft::num_traits::Zero;
use rustfft::Fft;
use std::sync::Arc;
use test::Bencher;
// Make fft using scalar planner
fn bench_scalar_32(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerScalar::new();
let fft: Arc<dyn Fft<f32>> = planner.plan_fft_forward(len);
let mut buffer: Vec<Complex<f32>> = vec![Complex::zero(); len];
let mut scratch: Vec<Complex<f32>> = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// Make fft using scalar planner
fn bench_scalar_64(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerScalar::new();
let fft: Arc<dyn Fft<f64>> = planner.plan_fft_forward(len);
let mut buffer: Vec<Complex<f64>> = vec![Complex::zero(); len];
let mut scratch: Vec<Complex<f64>> = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// Make fft using sse planner
fn bench_neon_32(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerNeon::new().unwrap();
let fft: Arc<dyn Fft<f32>> = planner.plan_fft_forward(len);
let mut buffer: Vec<Complex<f32>> = vec![Complex::zero(); len];
let mut scratch: Vec<Complex<f32>> = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// Make fft using sse planner
fn bench_neon_64(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerNeon::new().unwrap();
let fft: Arc<dyn Fft<f64>> = planner.plan_fft_forward(len);
let mut buffer: Vec<Complex<f64>> = vec![Complex::zero(); len];
let mut scratch: Vec<Complex<f64>> = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// Create benches using functions taking one argument
macro_rules! make_benches {
($name:ident, { $($len:literal),* }) => {
paste! {
$(
#[bench]
fn [<$name _ $len _f32_scalar>](b: &mut Bencher) {
[<bench_scalar_32>](b, $len);
}
#[bench]
fn [<$name _ $len _f64_scalar>](b: &mut Bencher) {
[<bench_scalar_64>](b, $len);
}
#[bench]
fn [<$name _ $len _f32_neon>](b: &mut Bencher) {
[<bench_neon_32>](b, $len);
}
#[bench]
fn [<$name _ $len _f64_neon>](b: &mut Bencher) {
[<bench_neon_64>](b, $len);
}
)*
}
}
}
make_benches!(neoncomparison, {4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072});
make_benches!(neoncomparison, { 262144, 524288, 1048576, 2097152, 4194304 });

View File

@@ -0,0 +1,124 @@
#![feature(test)]
extern crate rustfft;
extern crate test;
use paste::paste;
use rustfft::num_complex::Complex;
use rustfft::num_traits::Zero;
use rustfft::Fft;
use std::sync::Arc;
use test::Bencher;
// Make fft using scalar planner
fn bench_scalar_32(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerScalar::new();
let fft: Arc<dyn Fft<f32>> = planner.plan_fft_forward(len);
let mut buffer: Vec<Complex<f32>> = vec![Complex::zero(); len];
let mut scratch: Vec<Complex<f32>> = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// Make fft using scalar planner
fn bench_scalar_64(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerScalar::new();
let fft: Arc<dyn Fft<f64>> = planner.plan_fft_forward(len);
let mut buffer: Vec<Complex<f64>> = vec![Complex::zero(); len];
let mut scratch: Vec<Complex<f64>> = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// Make fft using sse planner
fn bench_sse_32(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerSse::new().unwrap();
let fft: Arc<dyn Fft<f32>> = planner.plan_fft_forward(len);
let mut buffer: Vec<Complex<f32>> = vec![Complex::zero(); len];
let mut scratch: Vec<Complex<f32>> = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// Make fft using sse planner
fn bench_sse_64(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerSse::new().unwrap();
let fft: Arc<dyn Fft<f64>> = planner.plan_fft_forward(len);
let mut buffer: Vec<Complex<f64>> = vec![Complex::zero(); len];
let mut scratch: Vec<Complex<f64>> = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// Make fft using sse planner
fn bench_avx_32(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerAvx::new().unwrap();
let fft: Arc<dyn Fft<f32>> = planner.plan_fft_forward(len);
let mut buffer: Vec<Complex<f32>> = vec![Complex::zero(); len];
let mut scratch: Vec<Complex<f32>> = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// Make fft using sse planner
fn bench_avx_64(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerAvx::new().unwrap();
let fft: Arc<dyn Fft<f64>> = planner.plan_fft_forward(len);
let mut buffer: Vec<Complex<f64>> = vec![Complex::zero(); len];
let mut scratch: Vec<Complex<f64>> = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// Create benches using functions taking one argument
macro_rules! make_benches {
($name:ident, { $($len:literal),* }) => {
paste! {
$(
#[bench]
fn [<$name _ $len _f32_scalar>](b: &mut Bencher) {
[<bench_scalar_32>](b, $len);
}
#[bench]
fn [<$name _ $len _f64_scalar>](b: &mut Bencher) {
[<bench_scalar_64>](b, $len);
}
#[bench]
fn [<$name _ $len _f32_sse>](b: &mut Bencher) {
[<bench_sse_32>](b, $len);
}
#[bench]
fn [<$name _ $len _f64_sse>](b: &mut Bencher) {
[<bench_sse_64>](b, $len);
}
#[bench]
fn [<$name _ $len _f32_avx>](b: &mut Bencher) {
[<bench_avx_32>](b, $len);
}
#[bench]
fn [<$name _ $len _f64_avx>](b: &mut Bencher) {
[<bench_avx_64>](b, $len);
}
)*
}
}
}
make_benches!(comparison, {16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768 });
make_benches!(comparison, {65536, 131072, 262144, 524288, 1048576, 2097152, 4194304 });

View File

@@ -0,0 +1,569 @@
#![allow(bare_trait_objects)]
#![allow(non_snake_case)]
#![feature(test)]
extern crate test;
extern crate rustfft;
use std::sync::Arc;
use test::Bencher;
use rustfft::{Direction, FftNum, Fft, FftDirection, Length};
use rustfft::num_complex::Complex;
use rustfft::num_traits::Zero;
use rustfft::algorithm::*;
use rustfft::algorithm::butterflies::*;
struct Noop {
len: usize,
direction: FftDirection,
}
impl<T: FftNum> Fft<T> for Noop {
fn process_with_scratch(&self, _buffer: &mut [Complex<T>], _scratch: &mut [Complex<T>]) {}
fn process_outofplace_with_scratch(&self, _input: &mut [Complex<T>], _output: &mut [Complex<T>], _scratch: &mut [Complex<T>]) {}
fn get_inplace_scratch_len(&self) -> usize { self.len }
fn get_outofplace_scratch_len(&self) -> usize { 0 }
}
impl Length for Noop {
fn len(&self) -> usize { self.len }
}
impl Direction for Noop {
fn fft_direction(&self) -> FftDirection { self.direction }
}
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length
fn bench_planned_f32(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlanner::new();
let fft: Arc<dyn Fft<f32>> = planner.plan_fft_forward(len);
assert_eq!(fft.len(), len);
let mut buffer = vec![Complex::zero(); len];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// Powers of 4
#[bench] fn planned32_p2_00000064(b: &mut Bencher) { bench_planned_f32(b, 64); }
#[bench] fn planned32_p2_00000128(b: &mut Bencher) { bench_planned_f32(b, 128); }
#[bench] fn planned32_p2_00000256(b: &mut Bencher) { bench_planned_f32(b, 256); }
#[bench] fn planned32_p2_00000512(b: &mut Bencher) { bench_planned_f32(b, 512); }
#[bench] fn planned32_p2_00001024(b: &mut Bencher) { bench_planned_f32(b, 1024); }
#[bench] fn planned32_p2_00002048(b: &mut Bencher) { bench_planned_f32(b, 2048); }
#[bench] fn planned32_p2_00004096(b: &mut Bencher) { bench_planned_f32(b, 4096); }
#[bench] fn planned32_p2_00016384(b: &mut Bencher) { bench_planned_f32(b, 16384); }
#[bench] fn planned32_p2_00065536(b: &mut Bencher) { bench_planned_f32(b, 65536); }
#[bench] fn planned32_p2_01048576(b: &mut Bencher) { bench_planned_f32(b, 1048576); }
#[bench] fn planned32_p2_16777216(b: &mut Bencher) { bench_planned_f32(b, 16777216); }
// Powers of 5
#[bench] fn planned32_p5_00125(b: &mut Bencher) { bench_planned_f32(b, 125); }
#[bench] fn planned32_p5_00625(b: &mut Bencher) { bench_planned_f32(b, 625); }
#[bench] fn planned32_p5_03125(b: &mut Bencher) { bench_planned_f32(b, 3125); }
#[bench] fn planned32_p5_15625(b: &mut Bencher) { bench_planned_f32(b, 15625); }
// Powers of 7
#[bench] fn planned32_p7_00343(b: &mut Bencher) { bench_planned_f32(b, 343); }
#[bench] fn planned32_p7_02401(b: &mut Bencher) { bench_planned_f32(b, 2401); }
#[bench] fn planned32_p7_16807(b: &mut Bencher) { bench_planned_f32(b, 16807); }
// Prime lengths
// Prime lengths
#[bench] fn planned32_prime_0005(b: &mut Bencher) { bench_planned_f32(b, 5); }
#[bench] fn planned32_prime_0017(b: &mut Bencher) { bench_planned_f32(b, 17); }
#[bench] fn planned32_prime_0149(b: &mut Bencher) { bench_planned_f32(b, 149); }
#[bench] fn planned32_prime_0151(b: &mut Bencher) { bench_planned_f32(b, 151); }
#[bench] fn planned32_prime_0251(b: &mut Bencher) { bench_planned_f32(b, 251); }
#[bench] fn planned32_prime_0257(b: &mut Bencher) { bench_planned_f32(b, 257); }
#[bench] fn planned32_prime_1009(b: &mut Bencher) { bench_planned_f32(b, 1009); }
#[bench] fn planned32_prime_1201(b: &mut Bencher) { bench_planned_f32(b, 1201); }
#[bench] fn planned32_prime_2017(b: &mut Bencher) { bench_planned_f32(b, 2017); }
#[bench] fn planned32_prime_2879(b: &mut Bencher) { bench_planned_f32(b, 2879); }
#[bench] fn planned32_prime_32767(b: &mut Bencher) { bench_planned_f32(b, 32767); }
#[bench] fn planned32_prime_65521(b: &mut Bencher) { bench_planned_f32(b, 65521); }
#[bench] fn planned32_prime_65537(b: &mut Bencher) { bench_planned_f32(b, 65537); }
#[bench] fn planned32_prime_746483(b: &mut Bencher) { bench_planned_f32(b,746483); }
#[bench] fn planned32_prime_746497(b: &mut Bencher) { bench_planned_f32(b,746497); }
//primes raised to a power
#[bench] fn planned32_primepower_044521(b: &mut Bencher) { bench_planned_f32(b, 44521); } // 211^2
#[bench] fn planned32_primepower_160801(b: &mut Bencher) { bench_planned_f32(b, 160801); } // 401^2
// numbers times powers of two
#[bench] fn planned32_composite_024576(b: &mut Bencher) { bench_planned_f32(b, 24576); }
#[bench] fn planned32_composite_020736(b: &mut Bencher) { bench_planned_f32(b, 20736); }
// power of 2 times large prime
#[bench] fn planned32_composite_032192(b: &mut Bencher) { bench_planned_f32(b, 32192); }
#[bench] fn planned32_composite_024028(b: &mut Bencher) { bench_planned_f32(b, 24028); }
// small mixed composites times a large prime
#[bench] fn planned32_composite_005472(b: &mut Bencher) { bench_planned_f32(b, 5472); }
#[bench] fn planned32_composite_030270(b: &mut Bencher) { bench_planned_f32(b, 30270); }
// small mixed composites
#[bench] fn planned32_composite_000018(b: &mut Bencher) { bench_planned_f32(b, 00018); }
#[bench] fn planned32_composite_000360(b: &mut Bencher) { bench_planned_f32(b, 00360); }
#[bench] fn planned32_composite_001200(b: &mut Bencher) { bench_planned_f32(b, 01200); }
#[bench] fn planned32_composite_044100(b: &mut Bencher) { bench_planned_f32(b, 44100); }
#[bench] fn planned32_composite_048000(b: &mut Bencher) { bench_planned_f32(b, 48000); }
#[bench] fn planned32_composite_046656(b: &mut Bencher) { bench_planned_f32(b, 46656); }
#[bench] fn planned32_composite_100000(b: &mut Bencher) { bench_planned_f32(b, 100000); }
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length
fn bench_planned_f64(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlanner::new();
let fft: Arc<dyn Fft<f64>> = planner.plan_fft_forward(len);
let mut buffer = vec![Complex::zero(); len];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| { fft.process_with_scratch(&mut buffer, &mut scratch); });
}
#[bench] fn planned64_p2_00000064(b: &mut Bencher) { bench_planned_f64(b, 64); }
#[bench] fn planned64_p2_00000128(b: &mut Bencher) { bench_planned_f64(b, 128); }
#[bench] fn planned64_p2_00000256(b: &mut Bencher) { bench_planned_f64(b, 256); }
#[bench] fn planned64_p2_00000512(b: &mut Bencher) { bench_planned_f64(b, 512); }
#[bench] fn planned64_p2_00001024(b: &mut Bencher) { bench_planned_f64(b, 1024); }
#[bench] fn planned64_p2_00002048(b: &mut Bencher) { bench_planned_f64(b, 2048); }
#[bench] fn planned64_p2_00004096(b: &mut Bencher) { bench_planned_f64(b, 4096); }
#[bench] fn planned64_p2_00016384(b: &mut Bencher) { bench_planned_f64(b, 16384); }
#[bench] fn planned64_p2_00065536(b: &mut Bencher) { bench_planned_f64(b, 65536); }
#[bench] fn planned64_p2_01048576(b: &mut Bencher) { bench_planned_f64(b, 1048576); }
//#[bench] fn planned64_p2_16777216(b: &mut Bencher) { bench_planned_f64(b, 16777216); }
// Powers of 5
#[bench] fn planned64_p5_00125(b: &mut Bencher) { bench_planned_f64(b, 125); }
#[bench] fn planned64_p5_00625(b: &mut Bencher) { bench_planned_f64(b, 625); }
#[bench] fn planned64_p5_03125(b: &mut Bencher) { bench_planned_f64(b, 3125); }
#[bench] fn planned64_p5_15625(b: &mut Bencher) { bench_planned_f64(b, 15625); }
#[bench] fn planned64_p7_00343(b: &mut Bencher) { bench_planned_f64(b, 343); }
#[bench] fn planned64_p7_02401(b: &mut Bencher) { bench_planned_f64(b, 2401); }
#[bench] fn planned64_p7_16807(b: &mut Bencher) { bench_planned_f64(b, 16807); }
// Prime lengths
#[bench] fn planned64_prime_0005(b: &mut Bencher) { bench_planned_f64(b, 5); }
#[bench] fn planned64_prime_0017(b: &mut Bencher) { bench_planned_f64(b, 17); }
#[bench] fn planned64_prime_0149(b: &mut Bencher) { bench_planned_f64(b, 149); }
#[bench] fn planned64_prime_0151(b: &mut Bencher) { bench_planned_f64(b, 151); }
#[bench] fn planned64_prime_0251(b: &mut Bencher) { bench_planned_f64(b, 251); }
#[bench] fn planned64_prime_0257(b: &mut Bencher) { bench_planned_f64(b, 257); }
#[bench] fn planned64_prime_1009(b: &mut Bencher) { bench_planned_f64(b, 1009); }
#[bench] fn planned64_prime_2017(b: &mut Bencher) { bench_planned_f64(b, 2017); }
#[bench] fn planned64_prime_2879(b: &mut Bencher) { bench_planned_f64(b, 2879); }
#[bench] fn planned64_prime_32767(b: &mut Bencher) { bench_planned_f64(b, 32767); }
#[bench] fn planned64_prime_65521(b: &mut Bencher) { bench_planned_f64(b, 65521); }
#[bench] fn planned64_prime_65537(b: &mut Bencher) { bench_planned_f64(b, 65537); }
#[bench] fn planned64_prime_746483(b: &mut Bencher) { bench_planned_f64(b,746483); }
#[bench] fn planned64_prime_746497(b: &mut Bencher) { bench_planned_f64(b,746497); }
//primes raised to a power
#[bench] fn planned64_primepower_044521(b: &mut Bencher) { bench_planned_f64(b, 44521); } // 211^2
#[bench] fn planned64_primepower_160801(b: &mut Bencher) { bench_planned_f64(b, 160801); } // 401^2
// numbers times powers of two
#[bench] fn planned64_composite_024576(b: &mut Bencher) { bench_planned_f64(b, 24576); }
#[bench] fn planned64_composite_020736(b: &mut Bencher) { bench_planned_f64(b, 20736); }
// power of 2 times large prime
#[bench] fn planned64_composite_032192(b: &mut Bencher) { bench_planned_f64(b, 32192); }
#[bench] fn planned64_composite_024028(b: &mut Bencher) { bench_planned_f64(b, 24028); }
// small mixed composites times a large prime
#[bench] fn planned64_composite_030270(b: &mut Bencher) { bench_planned_f64(b, 30270); }
// small mixed composites
#[bench] fn planned64_composite_000018(b: &mut Bencher) { bench_planned_f64(b, 00018); }
#[bench] fn planned64_composite_000360(b: &mut Bencher) { bench_planned_f64(b, 00360); }
#[bench] fn planned64_composite_044100(b: &mut Bencher) { bench_planned_f64(b, 44100); }
#[bench] fn planned64_composite_048000(b: &mut Bencher) { bench_planned_f64(b, 48000); }
#[bench] fn planned64_composite_046656(b: &mut Bencher) { bench_planned_f64(b, 46656); }
#[bench] fn planned64_composite_100000(b: &mut Bencher) { bench_planned_f64(b, 100000); }
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length, specific to the Good-Thomas algorithm
fn bench_good_thomas(b: &mut Bencher, width: usize, height: usize) {
let mut planner = rustfft::FftPlanner::new();
let width_fft = planner.plan_fft_forward(width);
let height_fft = planner.plan_fft_forward(height);
let fft : Arc<Fft<f32>> = Arc::new(GoodThomasAlgorithm::new(width_fft, height_fft));
let mut buffer = vec![Complex::zero(); width * height];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {fft.process_with_scratch(&mut buffer, &mut scratch);} );
}
#[bench] fn good_thomas_0002_3(b: &mut Bencher) { bench_good_thomas(b, 2, 3); }
#[bench] fn good_thomas_0003_4(b: &mut Bencher) { bench_good_thomas(b, 3, 4); }
#[bench] fn good_thomas_0004_5(b: &mut Bencher) { bench_good_thomas(b, 4, 5); }
#[bench] fn good_thomas_0007_32(b: &mut Bencher) { bench_good_thomas(b, 7, 32); }
#[bench] fn good_thomas_0032_27(b: &mut Bencher) { bench_good_thomas(b, 32, 27); }
#[bench] fn good_thomas_0256_243(b: &mut Bencher) { bench_good_thomas(b, 256, 243); }
#[bench] fn good_thomas_2048_3(b: &mut Bencher) { bench_good_thomas(b, 2048, 3); }
#[bench] fn good_thomas_2048_2187(b: &mut Bencher) { bench_good_thomas(b, 2048, 2187); }
/// Times just the FFT setup (not execution)
/// for a given length, specific to the Good-Thomas algorithm
fn bench_good_thomas_setup(b: &mut Bencher, width: usize, height: usize) {
let mut planner = rustfft::FftPlanner::new();
let width_fft = planner.plan_fft_forward(width);
let height_fft = planner.plan_fft_forward(height);
b.iter(|| {
let fft : Arc<Fft<f32>> = Arc::new(GoodThomasAlgorithm::new(Arc::clone(&width_fft), Arc::clone(&height_fft)));
test::black_box(fft);
});
}
#[bench] fn good_thomas_setup_0002_3(b: &mut Bencher) { bench_good_thomas_setup(b, 2, 3); }
#[bench] fn good_thomas_setup_0003_4(b: &mut Bencher) { bench_good_thomas_setup(b, 3, 4); }
#[bench] fn good_thomas_setup_0004_5(b: &mut Bencher) { bench_good_thomas_setup(b, 4, 5); }
#[bench] fn good_thomas_setup_0007_32(b: &mut Bencher) { bench_good_thomas_setup(b, 7, 32); }
#[bench] fn good_thomas_setup_0032_27(b: &mut Bencher) { bench_good_thomas_setup(b, 32, 27); }
#[bench] fn good_thomas_setup_0256_243(b: &mut Bencher) { bench_good_thomas_setup(b, 256, 243); }
#[bench] fn good_thomas_setup_2048_3(b: &mut Bencher) { bench_good_thomas_setup(b, 2048, 3); }
#[bench] fn good_thomas_setup_2048_2187(b: &mut Bencher) { bench_good_thomas_setup(b, 2048, 2187); }
/// Times just the FFT setup (not execution)
/// for a given length, specific to MixedRadix
fn bench_mixed_radix_setup(b: &mut Bencher, width: usize, height: usize) {
let mut planner = rustfft::FftPlanner::new();
let width_fft = planner.plan_fft_forward(width);
let height_fft = planner.plan_fft_forward(height);
b.iter(|| {
let fft : Arc<Fft<f32>> = Arc::new(MixedRadix::new(Arc::clone(&width_fft), Arc::clone(&height_fft)));
test::black_box(fft);
});
}
#[bench] fn setup_mixed_radix_0002_3(b: &mut Bencher) { bench_mixed_radix_setup(b, 2, 3); }
#[bench] fn setup_mixed_radix_0003_4(b: &mut Bencher) { bench_mixed_radix_setup(b, 3, 4); }
#[bench] fn setup_mixed_radix_0004_5(b: &mut Bencher) { bench_mixed_radix_setup(b, 4, 5); }
#[bench] fn setup_mixed_radix_0007_32(b: &mut Bencher) { bench_mixed_radix_setup(b, 7, 32); }
#[bench] fn setup_mixed_radix_0032_27(b: &mut Bencher) { bench_mixed_radix_setup(b, 32, 27); }
#[bench] fn setup_mixed_radix_0256_243(b: &mut Bencher) { bench_mixed_radix_setup(b, 256, 243); }
#[bench] fn setup_mixed_radix_2048_3(b: &mut Bencher) { bench_mixed_radix_setup(b, 2048, 3); }
#[bench] fn setup_mixed_radix_2048_2187(b: &mut Bencher) { bench_mixed_radix_setup(b, 2048, 2187); }
/// Times just the FFT setup (not execution)
/// for a given length, specific to MixedRadix
fn bench_small_mixed_radix_setup(b: &mut Bencher, width: usize, height: usize) {
let mut planner = rustfft::FftPlanner::new();
let width_fft = planner.plan_fft_forward(width);
let height_fft = planner.plan_fft_forward(height);
b.iter(|| {
let fft : Arc<Fft<f32>> = Arc::new(MixedRadixSmall::new(Arc::clone(&width_fft), Arc::clone(&height_fft)));
test::black_box(fft);
});
}
#[bench] fn setup_small_mixed_radix_0002_3(b: &mut Bencher) { bench_small_mixed_radix_setup(b, 2, 3); }
#[bench] fn setup_small_mixed_radix_0003_4(b: &mut Bencher) { bench_small_mixed_radix_setup(b, 3, 4); }
#[bench] fn setup_small_mixed_radix_0004_5(b: &mut Bencher) { bench_small_mixed_radix_setup(b, 4, 5); }
#[bench] fn setup_small_mixed_radix_0007_32(b: &mut Bencher) { bench_small_mixed_radix_setup(b, 7, 32); }
#[bench] fn setup_small_mixed_radix_0032_27(b: &mut Bencher) { bench_small_mixed_radix_setup(b, 32, 27); }
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length, specific to the Mixed-Radix algorithm
fn bench_mixed_radix(b: &mut Bencher, width: usize, height: usize) {
let mut planner = rustfft::FftPlanner::new();
let width_fft = planner.plan_fft_forward(width);
let height_fft = planner.plan_fft_forward(height);
let fft : Arc<Fft<_>> = Arc::new(MixedRadix::new(width_fft, height_fft));
let mut buffer = vec![Complex{re: 0_f32, im: 0_f32}; fft.len()];
let mut scratch = vec![Complex{re: 0_f32, im: 0_f32}; fft.get_inplace_scratch_len()];
b.iter(|| {fft.process_with_scratch(&mut buffer, &mut scratch);} );
}
#[bench] fn mixed_radix_0002_3(b: &mut Bencher) { bench_mixed_radix(b, 2, 3); }
#[bench] fn mixed_radix_0003_4(b: &mut Bencher) { bench_mixed_radix(b, 3, 4); }
#[bench] fn mixed_radix_0004_5(b: &mut Bencher) { bench_mixed_radix(b, 4, 5); }
#[bench] fn mixed_radix_0007_32(b: &mut Bencher) { bench_mixed_radix(b, 7, 32); }
#[bench] fn mixed_radix_0032_27(b: &mut Bencher) { bench_mixed_radix(b, 32, 27); }
#[bench] fn mixed_radix_0256_243(b: &mut Bencher) { bench_mixed_radix(b, 256, 243); }
#[bench] fn mixed_radix_2048_3(b: &mut Bencher) { bench_mixed_radix(b, 2048, 3); }
#[bench] fn mixed_radix_2048_2187(b: &mut Bencher) { bench_mixed_radix(b, 2048, 2187); }
fn plan_butterfly_fft(len: usize) -> Arc<Fft<f32>> {
match len {
2 => Arc::new(Butterfly2::new(FftDirection::Forward)),
3 => Arc::new(Butterfly3::new(FftDirection::Forward)),
4 => Arc::new(Butterfly4::new(FftDirection::Forward)),
5 => Arc::new(Butterfly5::new(FftDirection::Forward)),
6 => Arc::new(Butterfly6::new(FftDirection::Forward)),
7 => Arc::new(Butterfly7::new(FftDirection::Forward)),
8 => Arc::new(Butterfly8::new(FftDirection::Forward)),
16 => Arc::new(Butterfly16::new(FftDirection::Forward)),
32 => Arc::new(Butterfly32::new(FftDirection::Forward)),
_ => panic!("Invalid butterfly size: {}", len),
}
}
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length, specific to the MixedRadixSmall algorithm
fn bench_mixed_radix_small(b: &mut Bencher, width: usize, height: usize) {
let width_fft = plan_butterfly_fft(width);
let height_fft = plan_butterfly_fft(height);
let fft : Arc<Fft<_>> = Arc::new(MixedRadixSmall::new(width_fft, height_fft));
let mut signal = vec![Complex{re: 0_f32, im: 0_f32}; width * height];
let mut spectrum = signal.clone();
b.iter(|| {fft.process_with_scratch(&mut signal, &mut spectrum);} );
}
#[bench] fn mixed_radix_small_0002_3(b: &mut Bencher) { bench_mixed_radix_small(b, 2, 3); }
#[bench] fn mixed_radix_small_0003_4(b: &mut Bencher) { bench_mixed_radix_small(b, 3, 4); }
#[bench] fn mixed_radix_small_0004_5(b: &mut Bencher) { bench_mixed_radix_small(b, 4, 5); }
#[bench] fn mixed_radix_small_0007_32(b: &mut Bencher) { bench_mixed_radix_small(b, 7, 32); }
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length, specific to the Mixed-Radix Double Butterfly algorithm
fn bench_good_thomas_small(b: &mut Bencher, width: usize, height: usize) {
let width_fft = plan_butterfly_fft(width);
let height_fft = plan_butterfly_fft(height);
let fft : Arc<Fft<_>> = Arc::new(GoodThomasAlgorithmSmall::new(width_fft, height_fft));
let mut signal = vec![Complex{re: 0_f32, im: 0_f32}; width * height];
let mut spectrum = signal.clone();
b.iter(|| {fft.process_with_scratch(&mut signal, &mut spectrum);} );
}
#[bench] fn good_thomas_small_0002_3(b: &mut Bencher) { bench_good_thomas_small(b, 2, 3); }
#[bench] fn good_thomas_small_0003_4(b: &mut Bencher) { bench_good_thomas_small(b, 3, 4); }
#[bench] fn good_thomas_small_0004_5(b: &mut Bencher) { bench_good_thomas_small(b, 4, 5); }
#[bench] fn good_thomas_small_0007_32(b: &mut Bencher) { bench_good_thomas_small(b, 7, 32); }
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length, specific to Rader's algorithm
fn bench_raders_scalar(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlanner::new();
let inner_fft = planner.plan_fft_forward(len - 1);
let fft : Arc<Fft<_>> = Arc::new(RadersAlgorithm::new(inner_fft));
let mut buffer = vec![Complex{re: 0_f32, im: 0_f32}; len];
let mut scratch = vec![Complex{re: 0_f32, im: 0_f32}; fft.get_inplace_scratch_len()];
b.iter(|| {fft.process_with_scratch(&mut buffer, &mut scratch);} );
}
#[bench] fn raders_fft_scalar_prime_0005(b: &mut Bencher) { bench_raders_scalar(b, 5); }
#[bench] fn raders_fft_scalar_prime_0017(b: &mut Bencher) { bench_raders_scalar(b, 17); }
#[bench] fn raders_fft_scalar_prime_0149(b: &mut Bencher) { bench_raders_scalar(b, 149); }
#[bench] fn raders_fft_scalar_prime_0151(b: &mut Bencher) { bench_raders_scalar(b, 151); }
#[bench] fn raders_fft_scalar_prime_0251(b: &mut Bencher) { bench_raders_scalar(b, 251); }
#[bench] fn raders_fft_scalar_prime_0257(b: &mut Bencher) { bench_raders_scalar(b, 257); }
#[bench] fn raders_fft_scalar_prime_1009(b: &mut Bencher) { bench_raders_scalar(b, 1009); }
#[bench] fn raders_fft_scalar_prime_2017(b: &mut Bencher) { bench_raders_scalar(b, 2017); }
#[bench] fn raders_fft_scalar_prime_12289(b: &mut Bencher) { bench_raders_scalar(b, 12289); }
#[bench] fn raders_fft_scalar_prime_18433(b: &mut Bencher) { bench_raders_scalar(b, 18433); }
#[bench] fn raders_fft_scalar_prime_65521(b: &mut Bencher) { bench_raders_scalar(b, 65521); }
#[bench] fn raders_fft_scalar_prime_65537(b: &mut Bencher) { bench_raders_scalar(b, 65537); }
#[bench] fn raders_fft_scalar_prime_746483(b: &mut Bencher) { bench_raders_scalar(b,746483); }
#[bench] fn raders_fft_scalar_prime_746497(b: &mut Bencher) { bench_raders_scalar(b,746497); }
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length, specific to Bluestein's Algorithm
fn bench_bluesteins_scalar_prime(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlanner::new();
let inner_fft = planner.plan_fft_forward((len * 2 - 1).checked_next_power_of_two().unwrap());
let fft : Arc<Fft<f32>> = Arc::new(BluesteinsAlgorithm::new(len, inner_fft));
let mut buffer = vec![Zero::zero(); len];
let mut scratch = vec![Zero::zero(); fft.get_inplace_scratch_len()];
b.iter(|| { fft.process_with_scratch(&mut buffer, &mut scratch);} );
}
#[bench] fn bench_bluesteins_scalar_prime_0005(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 5); }
#[bench] fn bench_bluesteins_scalar_prime_0017(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 17); }
#[bench] fn bench_bluesteins_scalar_prime_0149(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 149); }
#[bench] fn bench_bluesteins_scalar_prime_0151(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 151); }
#[bench] fn bench_bluesteins_scalar_prime_0251(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 251); }
#[bench] fn bench_bluesteins_scalar_prime_0257(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 257); }
#[bench] fn bench_bluesteins_scalar_prime_1009(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 1009); }
#[bench] fn bench_bluesteins_scalar_prime_2017(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 2017); }
#[bench] fn bench_bluesteins_scalar_prime_32767(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 32767); }
#[bench] fn bench_bluesteins_scalar_prime_65521(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 65521); }
#[bench] fn bench_bluesteins_scalar_prime_65537(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 65537); }
#[bench] fn bench_bluesteins_scalar_prime_746483(b: &mut Bencher) { bench_bluesteins_scalar_prime(b,746483); }
#[bench] fn bench_bluesteins_scalar_prime_746497(b: &mut Bencher) { bench_bluesteins_scalar_prime(b,746497); }
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length, specific to Rader's algorithm
fn bench_radix4(b: &mut Bencher, len: usize) {
assert!(len % 4 == 0);
let fft = Radix4::new(len, FftDirection::Forward);
let mut signal = vec![Complex{re: 0_f32, im: 0_f32}; len];
let mut spectrum = signal.clone();
b.iter(|| {fft.process_outofplace_with_scratch(&mut signal, &mut spectrum, &mut []);} );
}
#[bench] fn radix4_______64(b: &mut Bencher) { bench_radix4(b, 64); }
#[bench] fn radix4______256(b: &mut Bencher) { bench_radix4(b, 256); }
#[bench] fn radix4_____1024(b: &mut Bencher) { bench_radix4(b, 1024); }
#[bench] fn radix4____65536(b: &mut Bencher) { bench_radix4(b, 65536); }
#[bench] fn radix4__1048576(b: &mut Bencher) { bench_radix4(b, 1048576); }
//#[bench] fn radix4_16777216(b: &mut Bencher) { bench_radix4(b, 16777216); }
fn get_mixed_radix_power2(len: usize) -> Arc<dyn Fft<f32>> {
match len {
8 => Arc::new(Butterfly8::new( FftDirection::Forward)),
16 => Arc::new(Butterfly16::new(FftDirection::Forward)),
32 => Arc::new(Butterfly32::new(FftDirection::Forward)),
_ => {
let zeroes = len.trailing_zeros();
assert!(zeroes % 2 == 0);
let half_zeroes = zeroes / 2;
let inner = get_mixed_radix_power2(1 << half_zeroes);
Arc::new(MixedRadix::new(Arc::clone(&inner), inner))
}
}
}
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length, specific to Rader's algorithm
fn bench_mixed_radix_power2(b: &mut Bencher, len: usize) {
let fft = get_mixed_radix_power2(len);
let mut buffer = vec![Zero::zero(); len];
let mut scratch = vec![Zero::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
#[bench] fn mixed_radix_power2__00000256(b: &mut Bencher) { bench_mixed_radix_power2(b, 256); }
#[bench] fn mixed_radix_power2__00001024(b: &mut Bencher) { bench_mixed_radix_power2(b, 1024); }
#[bench] fn mixed_radix_power2__00004096(b: &mut Bencher) { bench_mixed_radix_power2(b, 4096); }
#[bench] fn mixed_radix_power2__00065536(b: &mut Bencher) { bench_mixed_radix_power2(b, 65536); }
#[bench] fn mixed_radix_power2__01048576(b: &mut Bencher) { bench_mixed_radix_power2(b, 1048576); }
#[bench] fn mixed_radix_power2__16777216(b: &mut Bencher) { bench_mixed_radix_power2(b, 16777216); }
fn get_mixed_radix_inline_power2(len: usize) -> Arc<dyn Fft<f32>> {
match len {
8 => Arc::new(Butterfly8::new( FftDirection::Forward)),
16 => Arc::new(Butterfly16::new(FftDirection::Forward)),
32 => Arc::new(Butterfly32::new(FftDirection::Forward)),
_ => {
let zeroes = len.trailing_zeros();
assert!(zeroes % 2 == 0);
let half_zeroes = zeroes / 2;
let inner = get_mixed_radix_inline_power2(1 << half_zeroes);
Arc::new(MixedRadix::new(Arc::clone(&inner), inner))
}
}
}
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length, specific to Rader's algorithm
fn bench_mixed_radix_inline_power2(b: &mut Bencher, len: usize) {
let fft = get_mixed_radix_inline_power2(len);
let mut buffer = vec![Zero::zero(); len];
let mut scratch = vec![Zero::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
#[bench] fn mixed_radix_power2_inline__00000256(b: &mut Bencher) { bench_mixed_radix_inline_power2(b, 256); }
#[bench] fn mixed_radix_power2_inline__00001024(b: &mut Bencher) { bench_mixed_radix_inline_power2(b, 1024); }
#[bench] fn mixed_radix_power2_inline__00004096(b: &mut Bencher) { bench_mixed_radix_inline_power2(b, 4096); }
#[bench] fn mixed_radix_power2_inline__00065536(b: &mut Bencher) { bench_mixed_radix_inline_power2(b, 65536); }
#[bench] fn mixed_radix_power2_inline__01048576(b: &mut Bencher) { bench_mixed_radix_inline_power2(b, 1048576); }
#[bench] fn mixed_radix_power2_inline__16777216(b: &mut Bencher) { bench_mixed_radix_inline_power2(b, 16777216); }
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length
fn bench_butterfly32(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlanner::new();
let fft: Arc<dyn Fft<f32>> = planner.plan_fft_forward(len);
let mut buffer = vec![Complex::zero(); len * 10];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| { fft.process_with_scratch(&mut buffer, &mut scratch); });
}
#[bench] fn butterfly32_02(b: &mut Bencher) { bench_butterfly32(b, 2); }
#[bench] fn butterfly32_03(b: &mut Bencher) { bench_butterfly32(b, 3); }
#[bench] fn butterfly32_04(b: &mut Bencher) { bench_butterfly32(b, 4); }
#[bench] fn butterfly32_05(b: &mut Bencher) { bench_butterfly32(b, 5); }
#[bench] fn butterfly32_06(b: &mut Bencher) { bench_butterfly32(b, 6); }
#[bench] fn butterfly32_07(b: &mut Bencher) { bench_butterfly32(b, 7); }
#[bench] fn butterfly32_08(b: &mut Bencher) { bench_butterfly32(b, 8); }
#[bench] fn butterfly32_09(b: &mut Bencher) { bench_butterfly32(b, 9); }
#[bench] fn butterfly32_11(b: &mut Bencher) { bench_butterfly32(b, 11); }
#[bench] fn butterfly32_12(b: &mut Bencher) { bench_butterfly32(b, 12); }
#[bench] fn butterfly32_16(b: &mut Bencher) { bench_butterfly32(b, 16); }
#[bench] fn butterfly32_24(b: &mut Bencher) { bench_butterfly32(b, 24); }
#[bench] fn butterfly32_27(b: &mut Bencher) { bench_butterfly32(b, 27); }
#[bench] fn butterfly32_32(b: &mut Bencher) { bench_butterfly32(b, 32); }
#[bench] fn butterfly32_36(b: &mut Bencher) { bench_butterfly32(b, 36); }
#[bench] fn butterfly32_48(b: &mut Bencher) { bench_butterfly32(b, 48); }
#[bench] fn butterfly32_54(b: &mut Bencher) { bench_butterfly32(b, 54); }
#[bench] fn butterfly32_64(b: &mut Bencher) { bench_butterfly32(b, 64); }
#[bench] fn butterfly32_72(b: &mut Bencher) { bench_butterfly32(b, 72); }
#[bench] fn butterfly32_128(b: &mut Bencher) { bench_butterfly32(b, 128); }
#[bench] fn butterfly32_256(b: &mut Bencher) { bench_butterfly32(b, 256); }
#[bench] fn butterfly32_512(b: &mut Bencher) { bench_butterfly32(b, 512); }
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length
fn bench_butterfly64(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlanner::new();
let fft: Arc<dyn Fft<f64>> = planner.plan_fft_forward(len);
let mut buffer = vec![Complex::zero(); len * 10];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| { fft.process_with_scratch(&mut buffer, &mut scratch); });
}
#[bench] fn butterfly64_02(b: &mut Bencher) { bench_butterfly64(b, 2); }
#[bench] fn butterfly64_03(b: &mut Bencher) { bench_butterfly64(b, 3); }
#[bench] fn butterfly64_04(b: &mut Bencher) { bench_butterfly64(b, 4); }
#[bench] fn butterfly64_05(b: &mut Bencher) { bench_butterfly64(b, 5); }
#[bench] fn butterfly64_06(b: &mut Bencher) { bench_butterfly64(b, 6); }
#[bench] fn butterfly64_07(b: &mut Bencher) { bench_butterfly64(b, 7); }
#[bench] fn butterfly64_08(b: &mut Bencher) { bench_butterfly64(b, 8); }
#[bench] fn butterfly64_09(b: &mut Bencher) { bench_butterfly64(b, 9); }
#[bench] fn butterfly64_11(b: &mut Bencher) { bench_butterfly64(b, 11); }
#[bench] fn butterfly64_12(b: &mut Bencher) { bench_butterfly64(b, 12); }
#[bench] fn butterfly64_16(b: &mut Bencher) { bench_butterfly64(b, 16); }
#[bench] fn butterfly64_18(b: &mut Bencher) { bench_butterfly64(b, 18); }
#[bench] fn butterfly64_24(b: &mut Bencher) { bench_butterfly64(b, 24); }
#[bench] fn butterfly64_27(b: &mut Bencher) { bench_butterfly64(b, 27); }
#[bench] fn butterfly64_32(b: &mut Bencher) { bench_butterfly64(b, 32); }
#[bench] fn butterfly64_36(b: &mut Bencher) { bench_butterfly64(b, 36); }
#[bench] fn butterfly64_64(b: &mut Bencher) { bench_butterfly64(b, 64); }
#[bench] fn butterfly64_128(b: &mut Bencher) { bench_butterfly64(b, 128); }
#[bench] fn butterfly64_256(b: &mut Bencher) { bench_butterfly64(b, 256); }
#[bench] fn butterfly64_512(b: &mut Bencher) { bench_butterfly64(b, 512); }

View File

@@ -0,0 +1,172 @@
#![feature(test)]
extern crate rustfft;
extern crate test;
use rustfft::num_complex::Complex;
use rustfft::num_traits::Zero;
use rustfft::Fft;
use std::sync::Arc;
use test::Bencher;
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length
fn bench_planned_f32(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerNeon::new().unwrap();
let fft: Arc<dyn Fft<f32>> = planner.plan_fft_forward(len);
assert_eq!(fft.len(), len);
let mut buffer = vec![Complex::zero(); len];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
fn bench_planned_f64(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerNeon::new().unwrap();
let fft: Arc<dyn Fft<f64>> = planner.plan_fft_forward(len);
assert_eq!(fft.len(), len);
let mut buffer = vec![Complex::zero(); len];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length.
/// Run the fft on a 10*len vector, similar to how the butterflies are often used.
fn bench_planned_multi_f32(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerNeon::new().unwrap();
let fft: Arc<dyn Fft<f32>> = planner.plan_fft_forward(len);
let mut buffer = vec![Complex::zero(); len * 10];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
fn bench_planned_multi_f64(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerNeon::new().unwrap();
let fft: Arc<dyn Fft<f64>> = planner.plan_fft_forward(len);
let mut buffer = vec![Complex::zero(); len * 10];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// All butterflies
#[bench] fn neon_butterfly32_02(b: &mut Bencher) { bench_planned_multi_f32(b, 2);}
#[bench] fn neon_butterfly32_03(b: &mut Bencher) { bench_planned_multi_f32(b, 3);}
#[bench] fn neon_butterfly32_04(b: &mut Bencher) { bench_planned_multi_f32(b, 4);}
#[bench] fn neon_butterfly32_05(b: &mut Bencher) { bench_planned_multi_f32(b, 5);}
#[bench] fn neon_butterfly32_06(b: &mut Bencher) { bench_planned_multi_f32(b, 6);}
#[bench] fn neon_butterfly32_07(b: &mut Bencher) { bench_planned_multi_f32(b, 7);}
#[bench] fn neon_butterfly32_08(b: &mut Bencher) { bench_planned_multi_f32(b, 8);}
#[bench] fn neon_butterfly32_09(b: &mut Bencher) { bench_planned_multi_f32(b, 9);}
#[bench] fn neon_butterfly32_10(b: &mut Bencher) { bench_planned_multi_f32(b, 10);}
#[bench] fn neon_butterfly32_11(b: &mut Bencher) { bench_planned_multi_f32(b, 11);}
#[bench] fn neon_butterfly32_12(b: &mut Bencher) { bench_planned_multi_f32(b, 12);}
#[bench] fn neon_butterfly32_13(b: &mut Bencher) { bench_planned_multi_f32(b, 13);}
#[bench] fn neon_butterfly32_15(b: &mut Bencher) { bench_planned_multi_f32(b, 15);}
#[bench] fn neon_butterfly32_16(b: &mut Bencher) { bench_planned_multi_f32(b, 16);}
#[bench] fn neon_butterfly32_17(b: &mut Bencher) { bench_planned_multi_f32(b, 17);}
#[bench] fn neon_butterfly32_19(b: &mut Bencher) { bench_planned_multi_f32(b, 19);}
#[bench] fn neon_butterfly32_23(b: &mut Bencher) { bench_planned_multi_f32(b, 23);}
#[bench] fn neon_butterfly32_29(b: &mut Bencher) { bench_planned_multi_f32(b, 29);}
#[bench] fn neon_butterfly32_31(b: &mut Bencher) { bench_planned_multi_f32(b, 31);}
#[bench] fn neon_butterfly32_32(b: &mut Bencher) { bench_planned_multi_f32(b, 32);}
#[bench] fn neon_butterfly64_02(b: &mut Bencher) { bench_planned_multi_f64(b, 2);}
#[bench] fn neon_butterfly64_03(b: &mut Bencher) { bench_planned_multi_f64(b, 3);}
#[bench] fn neon_butterfly64_04(b: &mut Bencher) { bench_planned_multi_f64(b, 4);}
#[bench] fn neon_butterfly64_05(b: &mut Bencher) { bench_planned_multi_f64(b, 5);}
#[bench] fn neon_butterfly64_06(b: &mut Bencher) { bench_planned_multi_f64(b, 6);}
#[bench] fn neon_butterfly64_07(b: &mut Bencher) { bench_planned_multi_f64(b, 7);}
#[bench] fn neon_butterfly64_08(b: &mut Bencher) { bench_planned_multi_f64(b, 8);}
#[bench] fn neon_butterfly64_09(b: &mut Bencher) { bench_planned_multi_f64(b, 9);}
#[bench] fn neon_butterfly64_10(b: &mut Bencher) { bench_planned_multi_f64(b, 10);}
#[bench] fn neon_butterfly64_11(b: &mut Bencher) { bench_planned_multi_f64(b, 11);}
#[bench] fn neon_butterfly64_12(b: &mut Bencher) { bench_planned_multi_f64(b, 12);}
#[bench] fn neon_butterfly64_13(b: &mut Bencher) { bench_planned_multi_f64(b, 13);}
#[bench] fn neon_butterfly64_15(b: &mut Bencher) { bench_planned_multi_f64(b, 15);}
#[bench] fn neon_butterfly64_16(b: &mut Bencher) { bench_planned_multi_f64(b, 16);}
#[bench] fn neon_butterfly64_17(b: &mut Bencher) { bench_planned_multi_f64(b, 17);}
#[bench] fn neon_butterfly64_19(b: &mut Bencher) { bench_planned_multi_f64(b, 19);}
#[bench] fn neon_butterfly64_23(b: &mut Bencher) { bench_planned_multi_f64(b, 23);}
#[bench] fn neon_butterfly64_29(b: &mut Bencher) { bench_planned_multi_f64(b, 29);}
#[bench] fn neon_butterfly64_31(b: &mut Bencher) { bench_planned_multi_f64(b, 31);}
#[bench] fn neon_butterfly64_32(b: &mut Bencher) { bench_planned_multi_f64(b, 32);}
// Powers of 2
#[bench] fn neon_planned32_p2_00000064(b: &mut Bencher) { bench_planned_f32(b, 64); }
#[bench] fn neon_planned32_p2_00000128(b: &mut Bencher) { bench_planned_f32(b, 128); }
#[bench] fn neon_planned32_p2_00000256(b: &mut Bencher) { bench_planned_f32(b, 256); }
#[bench] fn neon_planned32_p2_00000512(b: &mut Bencher) { bench_planned_f32(b, 512); }
#[bench] fn neon_planned32_p2_00001024(b: &mut Bencher) { bench_planned_f32(b, 1024); }
#[bench] fn neon_planned32_p2_00002048(b: &mut Bencher) { bench_planned_f32(b, 2048); }
#[bench] fn neon_planned32_p2_00004096(b: &mut Bencher) { bench_planned_f32(b, 4096); }
#[bench] fn neon_planned32_p2_00016384(b: &mut Bencher) { bench_planned_f32(b, 16384); }
#[bench] fn neon_planned32_p2_00065536(b: &mut Bencher) { bench_planned_f32(b, 65536); }
#[bench] fn neon_planned32_p2_01048576(b: &mut Bencher) { bench_planned_f32(b, 1048576); }
#[bench] fn neon_planned64_p2_00000064(b: &mut Bencher) { bench_planned_f64(b, 64); }
#[bench] fn neon_planned64_p2_00000128(b: &mut Bencher) { bench_planned_f64(b, 128); }
#[bench] fn neon_planned64_p2_00000256(b: &mut Bencher) { bench_planned_f64(b, 256); }
#[bench] fn neon_planned64_p2_00000512(b: &mut Bencher) { bench_planned_f64(b, 512); }
#[bench] fn neon_planned64_p2_00001024(b: &mut Bencher) { bench_planned_f64(b, 1024); }
#[bench] fn neon_planned64_p2_00002048(b: &mut Bencher) { bench_planned_f64(b, 2048); }
#[bench] fn neon_planned64_p2_00004096(b: &mut Bencher) { bench_planned_f64(b, 4096); }
#[bench] fn neon_planned64_p2_00016384(b: &mut Bencher) { bench_planned_f64(b, 16384); }
#[bench] fn neon_planned64_p2_00065536(b: &mut Bencher) { bench_planned_f64(b, 65536); }
#[bench] fn neon_planned64_p2_01048576(b: &mut Bencher) { bench_planned_f64(b, 1048576); }
// Powers of 7
#[bench] fn neon_planned32_p7_00343(b: &mut Bencher) { bench_planned_f32(b, 343); }
#[bench] fn neon_planned32_p7_02401(b: &mut Bencher) { bench_planned_f32(b, 2401); }
#[bench] fn neon_planned32_p7_16807(b: &mut Bencher) { bench_planned_f32(b, 16807); }
#[bench] fn neon_planned64_p7_00343(b: &mut Bencher) { bench_planned_f64(b, 343); }
#[bench] fn neon_planned64_p7_02401(b: &mut Bencher) { bench_planned_f64(b, 2401); }
#[bench] fn neon_planned64_p7_16807(b: &mut Bencher) { bench_planned_f64(b, 16807); }
// Prime lengths
#[bench] fn neon_planned32_prime_0149(b: &mut Bencher) { bench_planned_f32(b, 149); }
#[bench] fn neon_planned32_prime_0151(b: &mut Bencher) { bench_planned_f32(b, 151); }
#[bench] fn neon_planned32_prime_0251(b: &mut Bencher) { bench_planned_f32(b, 251); }
#[bench] fn neon_planned32_prime_0257(b: &mut Bencher) { bench_planned_f32(b, 257); }
#[bench] fn neon_planned32_prime_2017(b: &mut Bencher) { bench_planned_f32(b, 2017); }
#[bench] fn neon_planned32_prime_2879(b: &mut Bencher) { bench_planned_f32(b, 2879); }
#[bench] fn neon_planned32_prime_65521(b: &mut Bencher) { bench_planned_f32(b, 65521); }
#[bench] fn neon_planned32_prime_746497(b: &mut Bencher) { bench_planned_f32(b,746497); }
#[bench] fn neon_planned64_prime_0149(b: &mut Bencher) { bench_planned_f64(b, 149); }
#[bench] fn neon_planned64_prime_0151(b: &mut Bencher) { bench_planned_f64(b, 151); }
#[bench] fn neon_planned64_prime_0251(b: &mut Bencher) { bench_planned_f64(b, 251); }
#[bench] fn neon_planned64_prime_0257(b: &mut Bencher) { bench_planned_f64(b, 257); }
#[bench] fn neon_planned64_prime_2017(b: &mut Bencher) { bench_planned_f64(b, 2017); }
#[bench] fn neon_planned64_prime_2879(b: &mut Bencher) { bench_planned_f64(b, 2879); }
#[bench] fn neon_planned64_prime_65521(b: &mut Bencher) { bench_planned_f64(b, 65521); }
#[bench] fn neon_planned64_prime_746497(b: &mut Bencher) { bench_planned_f64(b,746497); }
// small mixed composites
#[bench] fn neon_planned32_composite_000018(b: &mut Bencher) { bench_planned_f32(b, 00018); }
#[bench] fn neon_planned32_composite_000360(b: &mut Bencher) { bench_planned_f32(b, 00360); }
#[bench] fn neon_planned32_composite_001200(b: &mut Bencher) { bench_planned_f32(b, 01200); }
#[bench] fn neon_planned32_composite_044100(b: &mut Bencher) { bench_planned_f32(b, 44100); }
#[bench] fn neon_planned32_composite_048000(b: &mut Bencher) { bench_planned_f32(b, 48000); }
#[bench] fn neon_planned32_composite_046656(b: &mut Bencher) { bench_planned_f32(b, 46656); }
#[bench] fn neon_planned64_composite_000018(b: &mut Bencher) { bench_planned_f64(b, 00018); }
#[bench] fn neon_planned64_composite_000360(b: &mut Bencher) { bench_planned_f64(b, 00360); }
#[bench] fn neon_planned64_composite_001200(b: &mut Bencher) { bench_planned_f64(b, 01200); }
#[bench] fn neon_planned64_composite_044100(b: &mut Bencher) { bench_planned_f64(b, 44100); }
#[bench] fn neon_planned64_composite_048000(b: &mut Bencher) { bench_planned_f64(b, 48000); }
#[bench] fn neon_planned64_composite_046656(b: &mut Bencher) { bench_planned_f64(b, 46656); }

View File

@@ -0,0 +1,904 @@
#![allow(bare_trait_objects)]
#![allow(non_snake_case)]
#![feature(test)]
extern crate rustfft;
extern crate test;
use rustfft::algorithm::butterflies::*;
use rustfft::algorithm::*;
use rustfft::num_complex::Complex;
use rustfft::num_traits::Zero;
use rustfft::FftPlannerScalar;
use rustfft::{Direction, Fft, FftDirection, FftNum, Length};
use std::sync::Arc;
use test::Bencher;
struct Noop {
len: usize,
direction: FftDirection,
}
impl<T: FftNum> Fft<T> for Noop {
fn process_with_scratch(&self, _buffer: &mut [Complex<T>], _scratch: &mut [Complex<T>]) {}
fn process_outofplace_with_scratch(
&self,
_input: &mut [Complex<T>],
_output: &mut [Complex<T>],
_scratch: &mut [Complex<T>],
) {
}
fn get_inplace_scratch_len(&self) -> usize {
self.len
}
fn get_outofplace_scratch_len(&self) -> usize {
0
}
}
impl Length for Noop {
fn len(&self) -> usize {
self.len
}
}
impl Direction for Noop {
fn fft_direction(&self) -> FftDirection {
self.direction
}
}
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length
fn bench_planned_f32(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerScalar::new();
let fft: Arc<dyn Fft<f32>> = planner.plan_fft_forward(len);
assert_eq!(fft.len(), len);
let mut buffer = vec![Complex::zero(); len];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// Powers of 4
#[bench]
fn planned32_p2_00000064(b: &mut Bencher) {
bench_planned_f32(b, 64);
}
#[bench]
fn planned32_p2_00000128(b: &mut Bencher) {
bench_planned_f32(b, 128);
}
#[bench]
fn planned32_p2_00000256(b: &mut Bencher) {
bench_planned_f32(b, 256);
}
#[bench]
fn planned32_p2_00000512(b: &mut Bencher) {
bench_planned_f32(b, 512);
}
#[bench]
fn planned32_p2_00001024(b: &mut Bencher) {
bench_planned_f32(b, 1024);
}
#[bench]
fn planned32_p2_00002048(b: &mut Bencher) {
bench_planned_f32(b, 2048);
}
#[bench]
fn planned32_p2_00004096(b: &mut Bencher) {
bench_planned_f32(b, 4096);
}
#[bench]
fn planned32_p2_00016384(b: &mut Bencher) {
bench_planned_f32(b, 16384);
}
#[bench]
fn planned32_p2_00065536(b: &mut Bencher) {
bench_planned_f32(b, 65536);
}
#[bench]
fn planned32_p2_01048576(b: &mut Bencher) {
bench_planned_f32(b, 1048576);
}
//#[bench] fn planned32_p2_16777216(b: &mut Bencher) { bench_planned_f32(b, 16777216); }
// Powers of 5
//#[bench] fn planned32_p5_00125(b: &mut Bencher) { bench_planned_f32(b, 125); }
//#[bench] fn planned32_p5_00625(b: &mut Bencher) { bench_planned_f32(b, 625); }
//#[bench] fn planned32_p5_03125(b: &mut Bencher) { bench_planned_f32(b, 3125); }
//#[bench] fn planned32_p5_15625(b: &mut Bencher) { bench_planned_f32(b, 15625); }
// Powers of 7
//#[bench] fn planned32_p7_00343(b: &mut Bencher) { bench_planned_f32(b, 343); }
//#[bench] fn planned32_p7_02401(b: &mut Bencher) { bench_planned_f32(b, 2401); }
//#[bench] fn planned32_p7_16807(b: &mut Bencher) { bench_planned_f32(b, 16807); }
// Prime lengths
// Prime lengths
//#[bench] fn planned32_prime_0005(b: &mut Bencher) { bench_planned_f32(b, 5); }
//#[bench] fn planned32_prime_0017(b: &mut Bencher) { bench_planned_f32(b, 17); }
//#[bench] fn planned32_prime_0149(b: &mut Bencher) { bench_planned_f32(b, 149); }
//#[bench] fn planned32_prime_0151(b: &mut Bencher) { bench_planned_f32(b, 151); }
//#[bench] fn planned32_prime_0251(b: &mut Bencher) { bench_planned_f32(b, 251); }
//#[bench] fn planned32_prime_0257(b: &mut Bencher) { bench_planned_f32(b, 257); }
//#[bench] fn planned32_prime_1009(b: &mut Bencher) { bench_planned_f32(b, 1009); }
//#[bench] fn planned32_prime_1201(b: &mut Bencher) { bench_planned_f32(b, 1201); }
//#[bench] fn planned32_prime_2017(b: &mut Bencher) { bench_planned_f32(b, 2017); }
//#[bench] fn planned32_prime_2879(b: &mut Bencher) { bench_planned_f32(b, 2879); }
//#[bench] fn planned32_prime_32767(b: &mut Bencher) { bench_planned_f32(b, 32767); }
//#[bench] fn planned32_prime_65521(b: &mut Bencher) { bench_planned_f32(b, 65521); }
//#[bench] fn planned32_prime_65537(b: &mut Bencher) { bench_planned_f32(b, 65537); }
//#[bench] fn planned32_prime_746483(b: &mut Bencher) { bench_planned_f32(b,746483); }
//#[bench] fn planned32_prime_746497(b: &mut Bencher) { bench_planned_f32(b,746497); }
//primes raised to a power
//#[bench] fn planned32_primepower_044521(b: &mut Bencher) { bench_planned_f32(b, 44521); } // 211^2
//#[bench] fn planned32_primepower_160801(b: &mut Bencher) { bench_planned_f32(b, 160801); } // 401^2
// numbers times powers of two
//#[bench] fn planned32_composite_024576(b: &mut Bencher) { bench_planned_f32(b, 24576); }
//#[bench] fn planned32_composite_020736(b: &mut Bencher) { bench_planned_f32(b, 20736); }
// power of 2 times large prime
//#[bench] fn planned32_composite_032192(b: &mut Bencher) { bench_planned_f32(b, 32192); }
//#[bench] fn planned32_composite_024028(b: &mut Bencher) { bench_planned_f32(b, 24028); }
// small mixed composites times a large prime
//#[bench] fn planned32_composite_005472(b: &mut Bencher) { bench_planned_f32(b, 5472); }
//#[bench] fn planned32_composite_030270(b: &mut Bencher) { bench_planned_f32(b, 30270); }
// small mixed composites
//#[bench] fn planned32_composite_000018(b: &mut Bencher) { bench_planned_f32(b, 00018); }
//#[bench] fn planned32_composite_000360(b: &mut Bencher) { bench_planned_f32(b, 00360); }
//#[bench] fn planned32_composite_001200(b: &mut Bencher) { bench_planned_f32(b, 01200); }
//#[bench] fn planned32_composite_044100(b: &mut Bencher) { bench_planned_f32(b, 44100); }
//#[bench] fn planned32_composite_048000(b: &mut Bencher) { bench_planned_f32(b, 48000); }
//#[bench] fn planned32_composite_046656(b: &mut Bencher) { bench_planned_f32(b, 46656); }
//#[bench] fn planned32_composite_100000(b: &mut Bencher) { bench_planned_f32(b, 100000); }
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length
fn bench_planned_f64(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerScalar::new();
let fft: Arc<dyn Fft<f64>> = planner.plan_fft_forward(len);
let mut buffer = vec![Complex::zero(); len];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
#[bench]
fn planned64_p2_00000064(b: &mut Bencher) {
bench_planned_f64(b, 64);
}
#[bench]
fn planned64_p2_00000128(b: &mut Bencher) {
bench_planned_f64(b, 128);
}
#[bench]
fn planned64_p2_00000256(b: &mut Bencher) {
bench_planned_f64(b, 256);
}
#[bench]
fn planned64_p2_00000512(b: &mut Bencher) {
bench_planned_f64(b, 512);
}
#[bench]
fn planned64_p2_00001024(b: &mut Bencher) {
bench_planned_f64(b, 1024);
}
#[bench]
fn planned64_p2_00002048(b: &mut Bencher) {
bench_planned_f64(b, 2048);
}
#[bench]
fn planned64_p2_00004096(b: &mut Bencher) {
bench_planned_f64(b, 4096);
}
#[bench]
fn planned64_p2_00016384(b: &mut Bencher) {
bench_planned_f64(b, 16384);
}
#[bench]
fn planned64_p2_00065536(b: &mut Bencher) {
bench_planned_f64(b, 65536);
}
#[bench]
fn planned64_p2_01048576(b: &mut Bencher) {
bench_planned_f64(b, 1048576);
}
//#[bench] fn planned64_p2_16777216(b: &mut Bencher) { bench_planned_f64(b, 16777216); }
// Powers of 5
//#[bench] fn planned64_p5_00125(b: &mut Bencher) { bench_planned_f64(b, 125); }
//#[bench] fn planned64_p5_00625(b: &mut Bencher) { bench_planned_f64(b, 625); }
//#[bench] fn planned64_p5_03125(b: &mut Bencher) { bench_planned_f64(b, 3125); }
//#[bench] fn planned64_p5_15625(b: &mut Bencher) { bench_planned_f64(b, 15625); }
//#[bench] fn planned64_p7_00343(b: &mut Bencher) { bench_planned_f64(b, 343); }
//#[bench] fn planned64_p7_02401(b: &mut Bencher) { bench_planned_f64(b, 2401); }
//#[bench] fn planned64_p7_16807(b: &mut Bencher) { bench_planned_f64(b, 16807); }
// Prime lengths
//#[bench] fn planned64_prime_0005(b: &mut Bencher) { bench_planned_f64(b, 5); }
//#[bench] fn planned64_prime_0017(b: &mut Bencher) { bench_planned_f64(b, 17); }
//#[bench] fn planned64_prime_0149(b: &mut Bencher) { bench_planned_f64(b, 149); }
//#[bench] fn planned64_prime_0151(b: &mut Bencher) { bench_planned_f64(b, 151); }
//#[bench] fn planned64_prime_0251(b: &mut Bencher) { bench_planned_f64(b, 251); }
//#[bench] fn planned64_prime_0257(b: &mut Bencher) { bench_planned_f64(b, 257); }
//#[bench] fn planned64_prime_1009(b: &mut Bencher) { bench_planned_f64(b, 1009); }
//#[bench] fn planned64_prime_2017(b: &mut Bencher) { bench_planned_f64(b, 2017); }
//#[bench] fn planned64_prime_2879(b: &mut Bencher) { bench_planned_f64(b, 2879); }
//#[bench] fn planned64_prime_32767(b: &mut Bencher) { bench_planned_f64(b, 32767); }
//#[bench] fn planned64_prime_65521(b: &mut Bencher) { bench_planned_f64(b, 65521); }
//#[bench] fn planned64_prime_65537(b: &mut Bencher) { bench_planned_f64(b, 65537); }
//#[bench] fn planned64_prime_746483(b: &mut Bencher) { bench_planned_f64(b,746483); }
//#[bench] fn planned64_prime_746497(b: &mut Bencher) { bench_planned_f64(b,746497); }
//primes raised to a power
//#[bench] fn planned64_primepower_044521(b: &mut Bencher) { bench_planned_f64(b, 44521); } // 211^2
//#[bench] fn planned64_primepower_160801(b: &mut Bencher) { bench_planned_f64(b, 160801); } // 401^2
// numbers times powers of two
//#[bench] fn planned64_composite_024576(b: &mut Bencher) { bench_planned_f64(b, 24576); }
//#[bench] fn planned64_composite_020736(b: &mut Bencher) { bench_planned_f64(b, 20736); }
// power of 2 times large prime
//#[bench] fn planned64_composite_032192(b: &mut Bencher) { bench_planned_f64(b, 32192); }
//#[bench] fn planned64_composite_024028(b: &mut Bencher) { bench_planned_f64(b, 24028); }
// small mixed composites times a large prime
//#[bench] fn planned64_composite_030270(b: &mut Bencher) { bench_planned_f64(b, 30270); }
// small mixed composites
//#[bench] fn planned64_composite_000018(b: &mut Bencher) { bench_planned_f64(b, 00018); }
//#[bench] fn planned64_composite_000360(b: &mut Bencher) { bench_planned_f64(b, 00360); }
//#[bench] fn planned64_composite_044100(b: &mut Bencher) { bench_planned_f64(b, 44100); }
//#[bench] fn planned64_composite_048000(b: &mut Bencher) { bench_planned_f64(b, 48000); }
//#[bench] fn planned64_composite_046656(b: &mut Bencher) { bench_planned_f64(b, 46656); }
//#[bench] fn planned64_composite_100000(b: &mut Bencher) { bench_planned_f64(b, 100000); }
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length, specific to the Good-Thomas algorithm
fn bench_good_thomas(b: &mut Bencher, width: usize, height: usize) {
let mut planner = rustfft::FftPlannerScalar::new();
let width_fft = planner.plan_fft_forward(width);
let height_fft = planner.plan_fft_forward(height);
let fft: Arc<Fft<f32>> = Arc::new(GoodThomasAlgorithm::new(width_fft, height_fft));
let mut buffer = vec![Complex::zero(); width * height];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
#[bench]
fn good_thomas_0002_3(b: &mut Bencher) {
bench_good_thomas(b, 2, 3);
}
#[bench]
fn good_thomas_0003_4(b: &mut Bencher) {
bench_good_thomas(b, 3, 4);
}
#[bench]
fn good_thomas_0004_5(b: &mut Bencher) {
bench_good_thomas(b, 4, 5);
}
#[bench]
fn good_thomas_0007_32(b: &mut Bencher) {
bench_good_thomas(b, 7, 32);
}
#[bench]
fn good_thomas_0032_27(b: &mut Bencher) {
bench_good_thomas(b, 32, 27);
}
//#[bench] fn good_thomas_0256_243(b: &mut Bencher) { bench_good_thomas(b, 256, 243); }
//#[bench] fn good_thomas_2048_3(b: &mut Bencher) { bench_good_thomas(b, 2048, 3); }
//#[bench] fn good_thomas_2048_2187(b: &mut Bencher) { bench_good_thomas(b, 2048, 2187); }
/// Times just the FFT setup (not execution)
/// for a given length, specific to the Good-Thomas algorithm
fn bench_good_thomas_setup(b: &mut Bencher, width: usize, height: usize) {
let mut planner = rustfft::FftPlannerScalar::new();
let width_fft = planner.plan_fft_forward(width);
let height_fft = planner.plan_fft_forward(height);
b.iter(|| {
let fft: Arc<Fft<f32>> = Arc::new(GoodThomasAlgorithm::new(
Arc::clone(&width_fft),
Arc::clone(&height_fft),
));
test::black_box(fft);
});
}
#[bench]
fn good_thomas_setup_0002_3(b: &mut Bencher) {
bench_good_thomas_setup(b, 2, 3);
}
#[bench]
fn good_thomas_setup_0003_4(b: &mut Bencher) {
bench_good_thomas_setup(b, 3, 4);
}
#[bench]
fn good_thomas_setup_0004_5(b: &mut Bencher) {
bench_good_thomas_setup(b, 4, 5);
}
#[bench]
fn good_thomas_setup_0007_32(b: &mut Bencher) {
bench_good_thomas_setup(b, 7, 32);
}
#[bench]
fn good_thomas_setup_0032_27(b: &mut Bencher) {
bench_good_thomas_setup(b, 32, 27);
}
#[bench]
fn good_thomas_setup_0256_243(b: &mut Bencher) {
bench_good_thomas_setup(b, 256, 243);
}
#[bench]
fn good_thomas_setup_2048_3(b: &mut Bencher) {
bench_good_thomas_setup(b, 2048, 3);
}
#[bench]
fn good_thomas_setup_2048_2187(b: &mut Bencher) {
bench_good_thomas_setup(b, 2048, 2187);
}
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length, specific to the Mixed-Radix algorithm
fn bench_mixed_radix(b: &mut Bencher, width: usize, height: usize) {
let mut planner = rustfft::FftPlannerScalar::new();
let width_fft = planner.plan_fft_forward(width);
let height_fft = planner.plan_fft_forward(height);
let fft: Arc<Fft<_>> = Arc::new(MixedRadix::new(width_fft, height_fft));
let mut buffer = vec![
Complex {
re: 0_f32,
im: 0_f32
};
fft.len()
];
let mut scratch = vec![
Complex {
re: 0_f32,
im: 0_f32
};
fft.get_inplace_scratch_len()
];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
#[bench]
fn mixed_radix_0002_3(b: &mut Bencher) {
bench_mixed_radix(b, 2, 3);
}
#[bench]
fn mixed_radix_0003_4(b: &mut Bencher) {
bench_mixed_radix(b, 3, 4);
}
#[bench]
fn mixed_radix_0004_5(b: &mut Bencher) {
bench_mixed_radix(b, 4, 5);
}
#[bench]
fn mixed_radix_0007_32(b: &mut Bencher) {
bench_mixed_radix(b, 7, 32);
}
#[bench]
fn mixed_radix_0032_27(b: &mut Bencher) {
bench_mixed_radix(b, 32, 27);
}
//#[bench] fn mixed_radix_0256_243(b: &mut Bencher) { bench_mixed_radix(b, 256, 243); }
//#[bench] fn mixed_radix_2048_3(b: &mut Bencher) { bench_mixed_radix(b, 2048, 3); }
//#[bench] fn mixed_radix_2048_2187(b: &mut Bencher) { bench_mixed_radix(b, 2048, 2187); }
fn plan_butterfly_fft(len: usize) -> Arc<Fft<f32>> {
match len {
2 => Arc::new(Butterfly2::new(FftDirection::Forward)),
3 => Arc::new(Butterfly3::new(FftDirection::Forward)),
4 => Arc::new(Butterfly4::new(FftDirection::Forward)),
5 => Arc::new(Butterfly5::new(FftDirection::Forward)),
6 => Arc::new(Butterfly6::new(FftDirection::Forward)),
7 => Arc::new(Butterfly7::new(FftDirection::Forward)),
8 => Arc::new(Butterfly8::new(FftDirection::Forward)),
16 => Arc::new(Butterfly16::new(FftDirection::Forward)),
32 => Arc::new(Butterfly32::new(FftDirection::Forward)),
_ => panic!("Invalid butterfly size: {}", len),
}
}
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length, specific to the MixedRadixSmall algorithm
fn bench_mixed_radix_small(b: &mut Bencher, width: usize, height: usize) {
let width_fft = plan_butterfly_fft(width);
let height_fft = plan_butterfly_fft(height);
let fft: Arc<Fft<_>> = Arc::new(MixedRadixSmall::new(width_fft, height_fft));
let mut signal = vec![
Complex {
re: 0_f32,
im: 0_f32
};
width * height
];
let mut spectrum = signal.clone();
b.iter(|| {
fft.process_with_scratch(&mut signal, &mut spectrum);
});
}
#[bench]
fn mixed_radix_small_0002_3(b: &mut Bencher) {
bench_mixed_radix_small(b, 2, 3);
}
#[bench]
fn mixed_radix_small_0003_4(b: &mut Bencher) {
bench_mixed_radix_small(b, 3, 4);
}
#[bench]
fn mixed_radix_small_0004_5(b: &mut Bencher) {
bench_mixed_radix_small(b, 4, 5);
}
#[bench]
fn mixed_radix_small_0007_32(b: &mut Bencher) {
bench_mixed_radix_small(b, 7, 32);
}
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length, specific to the Mixed-Radix Double Butterfly algorithm
fn bench_good_thomas_small(b: &mut Bencher, width: usize, height: usize) {
let width_fft = plan_butterfly_fft(width);
let height_fft = plan_butterfly_fft(height);
let fft: Arc<Fft<_>> = Arc::new(GoodThomasAlgorithmSmall::new(width_fft, height_fft));
let mut signal = vec![
Complex {
re: 0_f32,
im: 0_f32
};
width * height
];
let mut spectrum = signal.clone();
b.iter(|| {
fft.process_with_scratch(&mut signal, &mut spectrum);
});
}
#[bench]
fn good_thomas_small_0002_3(b: &mut Bencher) {
bench_good_thomas_small(b, 2, 3);
}
#[bench]
fn good_thomas_small_0003_4(b: &mut Bencher) {
bench_good_thomas_small(b, 3, 4);
}
#[bench]
fn good_thomas_small_0004_5(b: &mut Bencher) {
bench_good_thomas_small(b, 4, 5);
}
#[bench]
fn good_thomas_small_0007_32(b: &mut Bencher) {
bench_good_thomas_small(b, 7, 32);
}
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length, specific to Rader's algorithm
#[allow(dead_code)]
fn bench_raders_scalar(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerScalar::new();
let inner_fft = planner.plan_fft_forward(len - 1);
let fft: Arc<Fft<_>> = Arc::new(RadersAlgorithm::new(inner_fft));
let mut buffer = vec![
Complex {
re: 0_f32,
im: 0_f32
};
len
];
let mut scratch = vec![
Complex {
re: 0_f32,
im: 0_f32
};
fft.get_inplace_scratch_len()
];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
//#[bench] fn raders_fft_scalar_prime_0005(b: &mut Bencher) { bench_raders_scalar(b, 5); }
//#[bench] fn raders_fft_scalar_prime_0017(b: &mut Bencher) { bench_raders_scalar(b, 17); }
//#[bench] fn raders_fft_scalar_prime_0149(b: &mut Bencher) { bench_raders_scalar(b, 149); }
//#[bench] fn raders_fft_scalar_prime_0151(b: &mut Bencher) { bench_raders_scalar(b, 151); }
//#[bench] fn raders_fft_scalar_prime_0251(b: &mut Bencher) { bench_raders_scalar(b, 251); }
//#[bench] fn raders_fft_scalar_prime_0257(b: &mut Bencher) { bench_raders_scalar(b, 257); }
//#[bench] fn raders_fft_scalar_prime_1009(b: &mut Bencher) { bench_raders_scalar(b, 1009); }
//#[bench] fn raders_fft_scalar_prime_2017(b: &mut Bencher) { bench_raders_scalar(b, 2017); }
//#[bench] fn raders_fft_scalar_prime_12289(b: &mut Bencher) { bench_raders_scalar(b, 12289); }
//#[bench] fn raders_fft_scalar_prime_18433(b: &mut Bencher) { bench_raders_scalar(b, 18433); }
//#[bench] fn raders_fft_scalar_prime_65521(b: &mut Bencher) { bench_raders_scalar(b, 65521); }
//#[bench] fn raders_fft_scalar_prime_65537(b: &mut Bencher) { bench_raders_scalar(b, 65537); }
//#[bench] fn raders_fft_scalar_prime_746483(b: &mut Bencher) { bench_raders_scalar(b,746483); }
//#[bench] fn raders_fft_scalar_prime_746497(b: &mut Bencher) { bench_raders_scalar(b,746497); }
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length, specific to Bluestein's Algorithm
#[allow(dead_code)]
fn bench_bluesteins_scalar_prime(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerScalar::new();
let inner_fft = planner.plan_fft_forward((len * 2 - 1).checked_next_power_of_two().unwrap());
let fft: Arc<Fft<f32>> = Arc::new(BluesteinsAlgorithm::new(len, inner_fft));
let mut buffer = vec![Zero::zero(); len];
let mut scratch = vec![Zero::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
//#[bench] fn bench_bluesteins_scalar_prime_0005(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 5); }
//#[bench] fn bench_bluesteins_scalar_prime_0017(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 17); }
//#[bench] fn bench_bluesteins_scalar_prime_0149(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 149); }
//#[bench] fn bench_bluesteins_scalar_prime_0151(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 151); }
//#[bench] fn bench_bluesteins_scalar_prime_0251(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 251); }
//#[bench] fn bench_bluesteins_scalar_prime_0257(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 257); }
//#[bench] fn bench_bluesteins_scalar_prime_1009(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 1009); }
//#[bench] fn bench_bluesteins_scalar_prime_2017(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 2017); }
//#[bench] fn bench_bluesteins_scalar_prime_32767(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 32767); }
//#[bench] fn bench_bluesteins_scalar_prime_65521(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 65521); }
//#[bench] fn bench_bluesteins_scalar_prime_65537(b: &mut Bencher) { bench_bluesteins_scalar_prime(b, 65537); }
//#[bench] fn bench_bluesteins_scalar_prime_746483(b: &mut Bencher) { bench_bluesteins_scalar_prime(b,746483); }
//#[bench] fn bench_bluesteins_scalar_prime_746497(b: &mut Bencher) { bench_bluesteins_scalar_prime(b,746497); }
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length, specific to Rader's algorithm
fn bench_radix4(b: &mut Bencher, len: usize) {
assert!(len % 4 == 0);
let fft = Radix4::new(len, FftDirection::Forward);
let mut signal = vec![
Complex {
re: 0_f32,
im: 0_f32
};
len
];
let mut spectrum = signal.clone();
b.iter(|| {
fft.process_outofplace_with_scratch(&mut signal, &mut spectrum, &mut []);
});
}
#[bench]
fn radix4_______64(b: &mut Bencher) {
bench_radix4(b, 64);
}
#[bench]
fn radix4______256(b: &mut Bencher) {
bench_radix4(b, 256);
}
#[bench]
fn radix4_____1024(b: &mut Bencher) {
bench_radix4(b, 1024);
}
#[bench]
fn radix4____65536(b: &mut Bencher) {
bench_radix4(b, 65536);
}
//#[bench] fn radix4__1048576(b: &mut Bencher) { bench_radix4(b, 1048576); }
//#[bench] fn radix4_16777216(b: &mut Bencher) { bench_radix4(b, 16777216); }
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length, specific to Rader's algorithm
fn bench_64_radix4(b: &mut Bencher, len: usize) {
assert!(len % 4 == 0);
let fft = Radix4::new(len, FftDirection::Forward);
let mut signal = vec![
Complex {
re: 0_f64,
im: 0_f64
};
len
];
let mut spectrum = signal.clone();
b.iter(|| {
fft.process_outofplace_with_scratch(&mut signal, &mut spectrum, &mut []);
});
}
#[bench]
fn radix4_64____64(b: &mut Bencher) {
bench_64_radix4(b, 64);
}
#[bench]
fn radix4_64___256(b: &mut Bencher) {
bench_64_radix4(b, 256);
}
#[bench]
fn radix4_64__1024(b: &mut Bencher) {
bench_64_radix4(b, 1024);
}
#[bench]
fn radix4_64_65536(b: &mut Bencher) {
bench_64_radix4(b, 65536);
}
//#[bench] fn radix4__1048576(b: &mut Bencher) { bench_radix4(b, 1048576); }
//#[bench] fn radix4_16777216(b: &mut Bencher) { bench_radix4(b, 16777216); }
fn get_mixed_radix_power2(len: usize) -> Arc<dyn Fft<f32>> {
match len {
8 => Arc::new(Butterfly8::new(FftDirection::Forward)),
16 => Arc::new(Butterfly16::new(FftDirection::Forward)),
32 => Arc::new(Butterfly32::new(FftDirection::Forward)),
_ => {
let zeroes = len.trailing_zeros();
assert!(zeroes % 2 == 0);
let half_zeroes = zeroes / 2;
let inner = get_mixed_radix_power2(1 << half_zeroes);
Arc::new(MixedRadix::new(Arc::clone(&inner), inner))
}
}
}
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length, specific to Rader's algorithm
fn bench_mixed_radix_power2(b: &mut Bencher, len: usize) {
let fft = get_mixed_radix_power2(len);
let mut buffer = vec![Zero::zero(); len];
let mut scratch = vec![Zero::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
#[bench]
fn mixed_radix_power2__00000256(b: &mut Bencher) {
bench_mixed_radix_power2(b, 256);
}
#[bench]
fn mixed_radix_power2__00001024(b: &mut Bencher) {
bench_mixed_radix_power2(b, 1024);
}
#[bench]
fn mixed_radix_power2__00004096(b: &mut Bencher) {
bench_mixed_radix_power2(b, 4096);
}
#[bench]
fn mixed_radix_power2__00065536(b: &mut Bencher) {
bench_mixed_radix_power2(b, 65536);
}
//#[bench] fn mixed_radix_power2__01048576(b: &mut Bencher) { bench_mixed_radix_power2(b, 1048576); }
//#[bench] fn mixed_radix_power2__16777216(b: &mut Bencher) { bench_mixed_radix_power2(b, 16777216); }
fn get_mixed_radix_inline_power2(len: usize) -> Arc<dyn Fft<f32>> {
match len {
8 => Arc::new(Butterfly8::new(FftDirection::Forward)),
16 => Arc::new(Butterfly16::new(FftDirection::Forward)),
32 => Arc::new(Butterfly32::new(FftDirection::Forward)),
_ => {
let zeroes = len.trailing_zeros();
assert!(zeroes % 2 == 0);
let half_zeroes = zeroes / 2;
let inner = get_mixed_radix_inline_power2(1 << half_zeroes);
Arc::new(MixedRadix::new(Arc::clone(&inner), inner))
}
}
}
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length, specific to Rader's algorithm
fn bench_mixed_radix_inline_power2(b: &mut Bencher, len: usize) {
let fft = get_mixed_radix_inline_power2(len);
let mut buffer = vec![Zero::zero(); len];
let mut scratch = vec![Zero::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
#[bench]
fn mixed_radix_power2_inline__00000256(b: &mut Bencher) {
bench_mixed_radix_inline_power2(b, 256);
}
#[bench]
fn mixed_radix_power2_inline__00001024(b: &mut Bencher) {
bench_mixed_radix_inline_power2(b, 1024);
}
#[bench]
fn mixed_radix_power2_inline__00004096(b: &mut Bencher) {
bench_mixed_radix_inline_power2(b, 4096);
}
#[bench]
fn mixed_radix_power2_inline__00065536(b: &mut Bencher) {
bench_mixed_radix_inline_power2(b, 65536);
}
//#[bench] fn mixed_radix_power2_inline__01048576(b: &mut Bencher) { bench_mixed_radix_inline_power2(b, 1048576); }
//#[bench] fn mixed_radix_power2_inline__16777216(b: &mut Bencher) { bench_mixed_radix_inline_power2(b, 16777216); }
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length
fn bench_butterfly32(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerScalar::new();
let fft: Arc<dyn Fft<f32>> = planner.plan_fft_forward(len);
let mut buffer = vec![Complex::zero(); len * 10];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
#[bench]
fn butterfly32_02(b: &mut Bencher) {
bench_butterfly32(b, 2);
}
#[bench]
fn butterfly32_03(b: &mut Bencher) {
bench_butterfly32(b, 3);
}
#[bench]
fn butterfly32_04(b: &mut Bencher) {
bench_butterfly32(b, 4);
}
#[bench]
fn butterfly32_05(b: &mut Bencher) {
bench_butterfly32(b, 5);
}
#[bench]
fn butterfly32_06(b: &mut Bencher) {
bench_butterfly32(b, 6);
}
#[bench]
fn butterfly32_07(b: &mut Bencher) {
bench_butterfly32(b, 7);
}
#[bench]
fn butterfly32_08(b: &mut Bencher) {
bench_butterfly32(b, 8);
}
#[bench]
fn butterfly32_09(b: &mut Bencher) {
bench_butterfly32(b, 9);
}
#[bench]
fn butterfly32_11(b: &mut Bencher) {
bench_butterfly32(b, 11);
}
#[bench]
fn butterfly32_12(b: &mut Bencher) {
bench_butterfly32(b, 12);
}
#[bench]
fn butterfly32_16(b: &mut Bencher) {
bench_butterfly32(b, 16);
}
//#[bench] fn butterfly32_24(b: &mut Bencher) { bench_butterfly32(b, 24); }
//#[bench] fn butterfly32_27(b: &mut Bencher) { bench_butterfly32(b, 27); }
//#[bench] fn butterfly32_32(b: &mut Bencher) { bench_butterfly32(b, 32); }
//#[bench] fn butterfly32_36(b: &mut Bencher) { bench_butterfly32(b, 36); }
//#[bench] fn butterfly32_48(b: &mut Bencher) { bench_butterfly32(b, 48); }
//#[bench] fn butterfly32_54(b: &mut Bencher) { bench_butterfly32(b, 54); }
//#[bench] fn butterfly32_64(b: &mut Bencher) { bench_butterfly32(b, 64); }
//#[bench] fn butterfly32_72(b: &mut Bencher) { bench_butterfly32(b, 72); }
//#[bench] fn butterfly32_128(b: &mut Bencher) { bench_butterfly32(b, 128); }
//#[bench] fn butterfly32_256(b: &mut Bencher) { bench_butterfly32(b, 256); }
//#[bench] fn butterfly32_512(b: &mut Bencher) { bench_butterfly32(b, 512); }
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length
fn bench_butterfly64(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerScalar::new();
let fft: Arc<dyn Fft<f64>> = planner.plan_fft_forward(len);
let mut buffer = vec![Complex::zero(); len * 10];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
#[bench]
fn butterfly64_02(b: &mut Bencher) {
bench_butterfly64(b, 2);
}
#[bench]
fn butterfly64_03(b: &mut Bencher) {
bench_butterfly64(b, 3);
}
#[bench]
fn butterfly64_04(b: &mut Bencher) {
bench_butterfly64(b, 4);
}
#[bench]
fn butterfly64_05(b: &mut Bencher) {
bench_butterfly64(b, 5);
}
#[bench]
fn butterfly64_06(b: &mut Bencher) {
bench_butterfly64(b, 6);
}
#[bench]
fn butterfly64_07(b: &mut Bencher) {
bench_butterfly64(b, 7);
}
#[bench]
fn butterfly64_08(b: &mut Bencher) {
bench_butterfly64(b, 8);
}
#[bench]
fn butterfly64_09(b: &mut Bencher) {
bench_butterfly64(b, 9);
}
#[bench]
fn butterfly64_11(b: &mut Bencher) {
bench_butterfly64(b, 11);
}
#[bench]
fn butterfly64_12(b: &mut Bencher) {
bench_butterfly64(b, 12);
}
#[bench]
fn butterfly64_16(b: &mut Bencher) {
bench_butterfly64(b, 16);
}
//#[bench] fn butterfly64_18(b: &mut Bencher) { bench_butterfly64(b, 18); }
//#[bench] fn butterfly64_24(b: &mut Bencher) { bench_butterfly64(b, 24); }
//#[bench] fn butterfly64_27(b: &mut Bencher) { bench_butterfly64(b, 27); }
//#[bench] fn butterfly64_32(b: &mut Bencher) { bench_butterfly64(b, 32); }
//#[bench] fn butterfly64_36(b: &mut Bencher) { bench_butterfly64(b, 36); }
//#[bench] fn butterfly64_64(b: &mut Bencher) { bench_butterfly64(b, 64); }
//#[bench] fn butterfly64_128(b: &mut Bencher) { bench_butterfly64(b, 128); }
//#[bench] fn butterfly64_256(b: &mut Bencher) { bench_butterfly64(b, 256); }
//#[bench] fn butterfly64_512(b: &mut Bencher) { bench_butterfly64(b, 512); }
fn bench_bluesteins_setup(b: &mut Bencher, len: usize) {
let inner_len = (len * 2 - 1).next_power_of_two();
let inner_fft = FftPlannerScalar::<f32>::new().plan_fft_forward(inner_len);
b.iter(|| {
test::black_box(BluesteinsAlgorithm::new(len, Arc::clone(&inner_fft)));
});
}
#[bench]
fn setup_bluesteins_0017(b: &mut Bencher) {
bench_bluesteins_setup(b, 17);
}
#[bench]
fn setup_bluesteins_0055(b: &mut Bencher) {
bench_bluesteins_setup(b, 55);
}
#[bench]
fn setup_bluesteins_0117(b: &mut Bencher) {
bench_bluesteins_setup(b, 117);
}
#[bench]
fn setup_bluesteins_0555(b: &mut Bencher) {
bench_bluesteins_setup(b, 555);
}
#[bench]
fn setup_bluesteins_1117(b: &mut Bencher) {
bench_bluesteins_setup(b, 1117);
}
#[bench]
fn setup_bluesteins_5555(b: &mut Bencher) {
bench_bluesteins_setup(b, 5555);
}

View File

@@ -0,0 +1,172 @@
#![feature(test)]
extern crate rustfft;
extern crate test;
use rustfft::num_complex::Complex;
use rustfft::num_traits::Zero;
use rustfft::Fft;
use std::sync::Arc;
use test::Bencher;
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length
fn bench_planned_f32(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerSse::new().unwrap();
let fft: Arc<dyn Fft<f32>> = planner.plan_fft_forward(len);
assert_eq!(fft.len(), len);
let mut buffer = vec![Complex::zero(); len];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
fn bench_planned_f64(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerSse::new().unwrap();
let fft: Arc<dyn Fft<f64>> = planner.plan_fft_forward(len);
assert_eq!(fft.len(), len);
let mut buffer = vec![Complex::zero(); len];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
/// Times just the FFT execution (not allocation and pre-calculation)
/// for a given length.
/// Run the fft on a 10*len vector, similar to how the butterflies are often used.
fn bench_planned_multi_f32(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerSse::new().unwrap();
let fft: Arc<dyn Fft<f32>> = planner.plan_fft_forward(len);
let mut buffer = vec![Complex::zero(); len * 10];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
fn bench_planned_multi_f64(b: &mut Bencher, len: usize) {
let mut planner = rustfft::FftPlannerSse::new().unwrap();
let fft: Arc<dyn Fft<f64>> = planner.plan_fft_forward(len);
let mut buffer = vec![Complex::zero(); len * 10];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// All butterflies
#[bench] fn sse_butterfly32_02(b: &mut Bencher) { bench_planned_multi_f32(b, 2);}
#[bench] fn sse_butterfly32_03(b: &mut Bencher) { bench_planned_multi_f32(b, 3);}
#[bench] fn sse_butterfly32_04(b: &mut Bencher) { bench_planned_multi_f32(b, 4);}
#[bench] fn sse_butterfly32_05(b: &mut Bencher) { bench_planned_multi_f32(b, 5);}
#[bench] fn sse_butterfly32_06(b: &mut Bencher) { bench_planned_multi_f32(b, 6);}
#[bench] fn sse_butterfly32_07(b: &mut Bencher) { bench_planned_multi_f32(b, 7);}
#[bench] fn sse_butterfly32_08(b: &mut Bencher) { bench_planned_multi_f32(b, 8);}
#[bench] fn sse_butterfly32_09(b: &mut Bencher) { bench_planned_multi_f32(b, 9);}
#[bench] fn sse_butterfly32_10(b: &mut Bencher) { bench_planned_multi_f32(b, 10);}
#[bench] fn sse_butterfly32_11(b: &mut Bencher) { bench_planned_multi_f32(b, 11);}
#[bench] fn sse_butterfly32_12(b: &mut Bencher) { bench_planned_multi_f32(b, 12);}
#[bench] fn sse_butterfly32_13(b: &mut Bencher) { bench_planned_multi_f32(b, 13);}
#[bench] fn sse_butterfly32_15(b: &mut Bencher) { bench_planned_multi_f32(b, 15);}
#[bench] fn sse_butterfly32_16(b: &mut Bencher) { bench_planned_multi_f32(b, 16);}
#[bench] fn sse_butterfly32_17(b: &mut Bencher) { bench_planned_multi_f32(b, 17);}
#[bench] fn sse_butterfly32_19(b: &mut Bencher) { bench_planned_multi_f32(b, 19);}
#[bench] fn sse_butterfly32_23(b: &mut Bencher) { bench_planned_multi_f32(b, 23);}
#[bench] fn sse_butterfly32_29(b: &mut Bencher) { bench_planned_multi_f32(b, 29);}
#[bench] fn sse_butterfly32_31(b: &mut Bencher) { bench_planned_multi_f32(b, 31);}
#[bench] fn sse_butterfly32_32(b: &mut Bencher) { bench_planned_multi_f32(b, 32);}
#[bench] fn sse_butterfly64_02(b: &mut Bencher) { bench_planned_multi_f64(b, 2);}
#[bench] fn sse_butterfly64_03(b: &mut Bencher) { bench_planned_multi_f64(b, 3);}
#[bench] fn sse_butterfly64_04(b: &mut Bencher) { bench_planned_multi_f64(b, 4);}
#[bench] fn sse_butterfly64_05(b: &mut Bencher) { bench_planned_multi_f64(b, 5);}
#[bench] fn sse_butterfly64_06(b: &mut Bencher) { bench_planned_multi_f64(b, 6);}
#[bench] fn sse_butterfly64_07(b: &mut Bencher) { bench_planned_multi_f64(b, 7);}
#[bench] fn sse_butterfly64_08(b: &mut Bencher) { bench_planned_multi_f64(b, 8);}
#[bench] fn sse_butterfly64_09(b: &mut Bencher) { bench_planned_multi_f64(b, 9);}
#[bench] fn sse_butterfly64_10(b: &mut Bencher) { bench_planned_multi_f64(b, 10);}
#[bench] fn sse_butterfly64_11(b: &mut Bencher) { bench_planned_multi_f64(b, 11);}
#[bench] fn sse_butterfly64_12(b: &mut Bencher) { bench_planned_multi_f64(b, 12);}
#[bench] fn sse_butterfly64_13(b: &mut Bencher) { bench_planned_multi_f64(b, 13);}
#[bench] fn sse_butterfly64_15(b: &mut Bencher) { bench_planned_multi_f64(b, 15);}
#[bench] fn sse_butterfly64_16(b: &mut Bencher) { bench_planned_multi_f64(b, 16);}
#[bench] fn sse_butterfly64_17(b: &mut Bencher) { bench_planned_multi_f64(b, 17);}
#[bench] fn sse_butterfly64_19(b: &mut Bencher) { bench_planned_multi_f64(b, 19);}
#[bench] fn sse_butterfly64_23(b: &mut Bencher) { bench_planned_multi_f64(b, 23);}
#[bench] fn sse_butterfly64_29(b: &mut Bencher) { bench_planned_multi_f64(b, 29);}
#[bench] fn sse_butterfly64_31(b: &mut Bencher) { bench_planned_multi_f64(b, 31);}
#[bench] fn sse_butterfly64_32(b: &mut Bencher) { bench_planned_multi_f64(b, 32);}
// Powers of 2
#[bench] fn sse_planned32_p2_00000064(b: &mut Bencher) { bench_planned_f32(b, 64); }
#[bench] fn sse_planned32_p2_00000128(b: &mut Bencher) { bench_planned_f32(b, 128); }
#[bench] fn sse_planned32_p2_00000256(b: &mut Bencher) { bench_planned_f32(b, 256); }
#[bench] fn sse_planned32_p2_00000512(b: &mut Bencher) { bench_planned_f32(b, 512); }
#[bench] fn sse_planned32_p2_00001024(b: &mut Bencher) { bench_planned_f32(b, 1024); }
#[bench] fn sse_planned32_p2_00002048(b: &mut Bencher) { bench_planned_f32(b, 2048); }
#[bench] fn sse_planned32_p2_00004096(b: &mut Bencher) { bench_planned_f32(b, 4096); }
#[bench] fn sse_planned32_p2_00016384(b: &mut Bencher) { bench_planned_f32(b, 16384); }
#[bench] fn sse_planned32_p2_00065536(b: &mut Bencher) { bench_planned_f32(b, 65536); }
#[bench] fn sse_planned32_p2_01048576(b: &mut Bencher) { bench_planned_f32(b, 1048576); }
#[bench] fn sse_planned64_p2_00000064(b: &mut Bencher) { bench_planned_f64(b, 64); }
#[bench] fn sse_planned64_p2_00000128(b: &mut Bencher) { bench_planned_f64(b, 128); }
#[bench] fn sse_planned64_p2_00000256(b: &mut Bencher) { bench_planned_f64(b, 256); }
#[bench] fn sse_planned64_p2_00000512(b: &mut Bencher) { bench_planned_f64(b, 512); }
#[bench] fn sse_planned64_p2_00001024(b: &mut Bencher) { bench_planned_f64(b, 1024); }
#[bench] fn sse_planned64_p2_00002048(b: &mut Bencher) { bench_planned_f64(b, 2048); }
#[bench] fn sse_planned64_p2_00004096(b: &mut Bencher) { bench_planned_f64(b, 4096); }
#[bench] fn sse_planned64_p2_00016384(b: &mut Bencher) { bench_planned_f64(b, 16384); }
#[bench] fn sse_planned64_p2_00065536(b: &mut Bencher) { bench_planned_f64(b, 65536); }
#[bench] fn sse_planned64_p2_01048576(b: &mut Bencher) { bench_planned_f64(b, 1048576); }
// Powers of 7
#[bench] fn sse_planned32_p7_00343(b: &mut Bencher) { bench_planned_f32(b, 343); }
#[bench] fn sse_planned32_p7_02401(b: &mut Bencher) { bench_planned_f32(b, 2401); }
#[bench] fn sse_planned32_p7_16807(b: &mut Bencher) { bench_planned_f32(b, 16807); }
#[bench] fn sse_planned64_p7_00343(b: &mut Bencher) { bench_planned_f64(b, 343); }
#[bench] fn sse_planned64_p7_02401(b: &mut Bencher) { bench_planned_f64(b, 2401); }
#[bench] fn sse_planned64_p7_16807(b: &mut Bencher) { bench_planned_f64(b, 16807); }
// Prime lengths
#[bench] fn sse_planned32_prime_0149(b: &mut Bencher) { bench_planned_f32(b, 149); }
#[bench] fn sse_planned32_prime_0151(b: &mut Bencher) { bench_planned_f32(b, 151); }
#[bench] fn sse_planned32_prime_0251(b: &mut Bencher) { bench_planned_f32(b, 251); }
#[bench] fn sse_planned32_prime_0257(b: &mut Bencher) { bench_planned_f32(b, 257); }
#[bench] fn sse_planned32_prime_2017(b: &mut Bencher) { bench_planned_f32(b, 2017); }
#[bench] fn sse_planned32_prime_2879(b: &mut Bencher) { bench_planned_f32(b, 2879); }
#[bench] fn sse_planned32_prime_65521(b: &mut Bencher) { bench_planned_f32(b, 65521); }
#[bench] fn sse_planned32_prime_746497(b: &mut Bencher) { bench_planned_f32(b,746497); }
#[bench] fn sse_planned64_prime_0149(b: &mut Bencher) { bench_planned_f64(b, 149); }
#[bench] fn sse_planned64_prime_0151(b: &mut Bencher) { bench_planned_f64(b, 151); }
#[bench] fn sse_planned64_prime_0251(b: &mut Bencher) { bench_planned_f64(b, 251); }
#[bench] fn sse_planned64_prime_0257(b: &mut Bencher) { bench_planned_f64(b, 257); }
#[bench] fn sse_planned64_prime_2017(b: &mut Bencher) { bench_planned_f64(b, 2017); }
#[bench] fn sse_planned64_prime_2879(b: &mut Bencher) { bench_planned_f64(b, 2879); }
#[bench] fn sse_planned64_prime_65521(b: &mut Bencher) { bench_planned_f64(b, 65521); }
#[bench] fn sse_planned64_prime_746497(b: &mut Bencher) { bench_planned_f64(b,746497); }
// small mixed composites
#[bench] fn sse_planned32_composite_000018(b: &mut Bencher) { bench_planned_f32(b, 00018); }
#[bench] fn sse_planned32_composite_000360(b: &mut Bencher) { bench_planned_f32(b, 00360); }
#[bench] fn sse_planned32_composite_001200(b: &mut Bencher) { bench_planned_f32(b, 01200); }
#[bench] fn sse_planned32_composite_044100(b: &mut Bencher) { bench_planned_f32(b, 44100); }
#[bench] fn sse_planned32_composite_048000(b: &mut Bencher) { bench_planned_f32(b, 48000); }
#[bench] fn sse_planned32_composite_046656(b: &mut Bencher) { bench_planned_f32(b, 46656); }
#[bench] fn sse_planned64_composite_000018(b: &mut Bencher) { bench_planned_f64(b, 00018); }
#[bench] fn sse_planned64_composite_000360(b: &mut Bencher) { bench_planned_f64(b, 00360); }
#[bench] fn sse_planned64_composite_001200(b: &mut Bencher) { bench_planned_f64(b, 01200); }
#[bench] fn sse_planned64_composite_044100(b: &mut Bencher) { bench_planned_f64(b, 44100); }
#[bench] fn sse_planned64_composite_048000(b: &mut Bencher) { bench_planned_f64(b, 48000); }
#[bench] fn sse_planned64_composite_046656(b: &mut Bencher) { bench_planned_f64(b, 46656); }

View File

@@ -0,0 +1,776 @@
#![feature(test)]
#![allow(non_snake_case)]
#![allow(unused)]
extern crate rustfft;
extern crate test;
use test::Bencher;
use rustfft::algorithm::butterflies::*;
use rustfft::algorithm::Dft;
use rustfft::num_complex::Complex;
use rustfft::num_traits::Zero;
use rustfft::{Fft, FftNum};
use rustfft::{FftPlanner, FftPlannerAvx};
use primal_check::miller_rabin;
use std::sync::Arc;
/// This benchmark's purpose is to build some programmer intuition for planner heuristics
/// We have mixed radix 2xn, 3xn, 4xn, 6xn, 8xn, 9x, 12xn, and 16xn implementations -- for a given FFT of the form 2^xn * 3^m, which combination is the fastest? Is 12xn -> 4xn faster than 6xn -> 8xn?
/// Is it faster to put 9xn as an outer FFT of 8xn or as an inner FFT? this file autogenerates benchmarks that answer these questions
///
/// The "generate_3n2m_comparison_benchmarks" benchmark will print benchmark code to the console which should be pasted back into this file, basically a low-budget procedural macro
#[derive(Clone, Debug)]
struct FftSize {
len: usize,
power2: u32,
power3: u32,
}
impl FftSize {
fn new(len: usize) -> Self {
let power2 = len.trailing_zeros();
let mut remaining_factors = len >> power2;
let mut power3 = 0;
while remaining_factors % 3 == 0 {
power3 += 1;
remaining_factors /= 3;
}
assert!(remaining_factors == 1);
Self {
power2,
power3,
len,
}
}
fn divide(&self, other: &Self) -> Option<Self> {
if self.power2 <= other.power2 && self.power3 <= other.power3 {
Some(Self {
power2: other.power2 - self.power2,
power3: other.power3 - self.power3,
len: other.len / self.len,
})
} else {
None
}
}
}
// We don't need to generate a combinatoric explosion of tests that we know will be slow. filter_radix applies some dumb heuristics to filter out the most common slow cases
fn filter_radix(current_strategy: &[usize], potential_radix: &FftSize, is_butterfly: bool) -> bool {
// if we've seen any radix larger than this before, reject. otherwise we'll get a million reorderings of the same radixex, with benchmarking showing that smaller being higher is typically faster
if !is_butterfly
&& current_strategy
.iter()
.find(|i| **i > potential_radix.len && **i != 16)
.is_some()
{
return false;
}
// apply filters to size 2
if potential_radix.len == 2 {
// if our strategy already contains any 2's, 3's, or 4's, reject -- because 4, 6, or 8 will be faster, respectively
return !current_strategy.contains(&2)
&& !current_strategy.contains(&3)
&& !current_strategy.contains(&4);
}
// apply filters to size 3
if potential_radix.len == 3 {
// if our strategy already contains any 2's, 3's or 4s, reject -- because 6 and 9 and 12 will be faster, respectively
return !current_strategy.contains(&2)
&& !current_strategy.contains(&3)
&& !current_strategy.contains(&4);
}
// apply filters to size 4
if potential_radix.len == 4 {
// if our strategy already contains any 2's, reject -- because 8 will be faster
// if our strategy already contains 2 4's, don't add a third, because 2 8's would have been faster
// if our strategy already contains a 16, reject -- because 2 8's will be faster (8s are seriously fast guys)
return !current_strategy.contains(&2)
&& !current_strategy.contains(&3)
&& !current_strategy.contains(&4)
&& !current_strategy.contains(&16);
}
if potential_radix.len == 16 {
// if our strategy already contains a 4, reject -- because 2 8's will be faster (8s are seriously fast guys)
// if our strategy already contains a 16, reject -- benchmarking shows that 16s are very situational, and repeating them never helps)
return !current_strategy.contains(&4) && !current_strategy.contains(&16);
}
return true;
}
fn recursive_strategy_builder(
strategy_list: &mut Vec<Vec<usize>>,
last_ditch_strategy_list: &mut Vec<Vec<usize>>,
mut current_strategy: Vec<usize>,
len: FftSize,
butterfly_sizes: &[usize],
last_ditch_butterflies: &[usize],
available_radixes: &[FftSize],
) {
if butterfly_sizes.contains(&len.len) {
if filter_radix(&current_strategy, &len, true) {
current_strategy.push(len.len);
//If this strategy contains a 2 or 3, it's very unlikely to be the fastest. we don't want to rule it out, because it's required sometimes, but don't use it unless there aren't any other
if current_strategy.contains(&2) || current_strategy.contains(&3) {
strategy_list.push(current_strategy.clone());
} else {
strategy_list.push(current_strategy.clone());
}
}
} else if last_ditch_butterflies.contains(&len.len) {
if filter_radix(&current_strategy, &len, true) {
current_strategy.push(len.len);
last_ditch_strategy_list.push(current_strategy.clone());
}
} else if len.len > 1 {
for radix in available_radixes {
if filter_radix(&current_strategy, radix, false) {
if let Some(inner) = radix.divide(&len) {
let mut cloned_strategy = current_strategy.clone();
cloned_strategy.push(radix.len);
recursive_strategy_builder(
strategy_list,
last_ditch_strategy_list,
cloned_strategy,
inner,
butterfly_sizes,
last_ditch_butterflies,
available_radixes,
);
}
}
}
}
}
// it's faster to filter strategies at the radix level since we can prune entire permutations, but some can only be done once the full plan is built
fn filter_strategy(strategy: &Vec<usize>) -> bool {
if strategy.contains(&16) {
let index = strategy.iter().position(|s| *s == 16).unwrap();
index == 0
|| index == strategy.len() - 1
|| index == strategy.len() - 2
|| (strategy[index - 1] < 12 && strategy[index + 1] >= 12)
} else {
true
}
}
// cargo bench generate_3n2m_comparison_benchmarks_32 -- --nocapture --ignored
#[ignore]
#[bench]
fn generate_3n2m_comparison_benchmarks_32(_: &mut test::Bencher) {
let butterfly_sizes = [128, 256, 512, 72, 36, 48, 54, 64];
let last_ditch_butterflies = [27, 9, 32, 24];
let available_radixes = [
FftSize::new(3),
FftSize::new(4),
FftSize::new(6),
FftSize::new(8),
FftSize::new(9),
FftSize::new(12),
FftSize::new(16),
];
let max_len: usize = 1 << 21;
let min_len = 64;
let max_power2 = max_len.trailing_zeros();
let max_power3 = (max_len as f32).log(3.0).ceil() as u32;
for power3 in 1..2 {
for power2 in 4..max_power2 {
let len = 3usize.pow(power3) << power2;
if len > max_len {
continue;
}
//let planned_fft : Arc<dyn Fft<f32>> = rustfft::FftPlanner::new(false).plan_fft(len);
// we want to catalog all the different possible ways there are to compute a FFT of size `len`
// we can do that by recursively looping over each radix, dividing our length by that radix, then recursively trying rach radix again
let mut strategies = vec![];
let mut last_ditch_strategies = vec![];
recursive_strategy_builder(
&mut strategies,
&mut last_ditch_strategies,
Vec::new(),
FftSize::new(len),
&butterfly_sizes,
&last_ditch_butterflies,
&available_radixes,
);
if strategies.len() == 0 {
strategies = last_ditch_strategies;
}
for mut s in strategies.into_iter().filter(filter_strategy) {
s.reverse();
let strategy_strings: Vec<_> = s.into_iter().map(|i| i.to_string()).collect();
let test_id = strategy_strings.join("_");
let strategy_array = strategy_strings.join(",");
println!("#[bench] fn comparef32__2power{:02}__3power{:02}__len{:08}__{}(b: &mut Bencher) {{ compare_fft_f32(b, &[{}]); }}", power2, power3, len, test_id, strategy_array);
}
}
}
}
// cargo bench generate_3n2m_comparison_benchmarks_64 -- --nocapture --ignored
#[ignore]
#[bench]
fn generate_3n2m_comparison_benchmarks_64(_: &mut test::Bencher) {
let butterfly_sizes = [512, 256, 128, 64, 36, 27, 24, 18, 12];
let last_ditch_butterflies = [32, 16, 8, 9];
let available_radixes = [
FftSize::new(3),
FftSize::new(4),
FftSize::new(6),
FftSize::new(8),
FftSize::new(9),
FftSize::new(12),
];
let max_len: usize = 1 << 21;
let min_len = 64;
let max_power2 = max_len.trailing_zeros();
let max_power3 = (max_len as f32).log(3.0).ceil() as u32;
for power3 in 0..1 {
for power2 in 3..max_power2 {
let len = 3usize.pow(power3) << power2;
if len > max_len {
continue;
}
//let planned_fft : Arc<dyn Fft<f32>> = rustfft::FftPlanner::new(false).plan_fft(len);
// we want to catalog all the different possible ways there are to compute a FFT of size `len`
// we can do that by recursively looping over each radix, dividing our length by that radix, then recursively trying rach radix again
// we can do that by recursively looping over each radix, dividing our length by that radix, then recursively trying rach radix again
let mut strategies = vec![];
let mut last_ditch_strategies = vec![];
recursive_strategy_builder(
&mut strategies,
&mut last_ditch_strategies,
Vec::new(),
FftSize::new(len),
&butterfly_sizes,
&last_ditch_butterflies,
&available_radixes,
);
if strategies.len() == 0 {
strategies = last_ditch_strategies;
}
for mut s in strategies.into_iter().filter(filter_strategy) {
s.reverse();
let strategy_strings: Vec<_> = s.into_iter().map(|i| i.to_string()).collect();
let test_id = strategy_strings.join("_");
let strategy_array = strategy_strings.join(",");
println!("#[bench] fn comparef64__2power{:02}__3power{:02}__len{:08}__{}(b: &mut Bencher) {{ compare_fft_f64(b, &[{}]); }}", power2, power3, len, test_id, strategy_array);
}
}
}
}
// cargo bench generate_3n2m_planned_benchmarks_32 -- --nocapture --ignored
#[ignore]
#[bench]
fn generate_3n2m_planned_benchmarks(_: &mut test::Bencher) {
let mut fft_sizes = vec![];
let max_len: usize = 1 << 23;
let max_power2 = max_len.trailing_zeros();
let max_power3 = (max_len as f32).log(3.0).ceil() as u32;
for power2 in 0..max_power2 {
for power3 in 0..max_power3 {
let len = 3usize.pow(power3) << power2;
if len > max_len {
continue;
}
if power3 < 2 && power2 > 16 {
continue;
}
if power3 < 3 && power2 > 17 {
continue;
}
if power2 < 1 {
continue;
}
fft_sizes.push(len);
}
}
for len in fft_sizes {
let power2 = len.trailing_zeros();
let mut remaining_factors = len >> power2;
let mut power3 = 0;
while remaining_factors % 3 == 0 {
power3 += 1;
remaining_factors /= 3;
}
println!("#[bench] fn comparef32_len{:07}_2power{:02}_3power{:02}(b: &mut Bencher) {{ bench_planned_fft_f32(b, {}); }}",len, power2, power3, len);
}
}
// cargo bench generate_3n2m_planned_benchmarks_64 -- --nocapture --ignored
#[ignore]
#[bench]
fn generate_3n2m_planned_benchmarks_64(_: &mut test::Bencher) {
let mut fft_sizes = vec![];
let max_len: usize = 1 << 23;
let max_power2 = max_len.trailing_zeros();
let max_power3 = (max_len as f32).log(3.0).ceil() as u32;
for power2 in 0..max_power2 {
for power3 in 0..max_power3 {
let len = 3usize.pow(power3) << power2;
if len > max_len {
continue;
}
if power3 < 1 && power2 > 13 {
continue;
}
if power3 < 4 && power2 > 14 {
continue;
}
if power2 < 2 {
continue;
}
fft_sizes.push(len);
}
}
for len in fft_sizes {
let power2 = len.trailing_zeros();
let mut remaining_factors = len >> power2;
let mut power3 = 0;
while remaining_factors % 3 == 0 {
power3 += 1;
remaining_factors /= 3;
}
println!("#[bench] fn comparef64_len{:07}_2power{:02}_3power{:02}(b: &mut Bencher) {{ bench_planned_fft_f64(b, {}); }}",len, power2, power3, len);
}
}
#[derive(Copy, Clone, Debug)]
pub struct PartialFactors {
power2: u32,
power3: u32,
power5: u32,
power7: u32,
power11: u32,
other_factors: usize,
}
impl PartialFactors {
pub fn compute(len: usize) -> Self {
let power2 = len.trailing_zeros();
let mut other_factors = len >> power2;
let mut power3 = 0;
while other_factors % 3 == 0 {
power3 += 1;
other_factors /= 3;
}
let mut power5 = 0;
while other_factors % 5 == 0 {
power5 += 1;
other_factors /= 5;
}
let mut power7 = 0;
while other_factors % 7 == 0 {
power7 += 1;
other_factors /= 7;
}
let mut power11 = 0;
while other_factors % 11 == 0 {
power11 += 1;
other_factors /= 11;
}
Self {
power2,
power3,
power5,
power7,
power11,
other_factors,
}
}
pub fn get_power2(&self) -> u32 {
self.power2
}
pub fn get_power3(&self) -> u32 {
self.power3
}
pub fn get_power5(&self) -> u32 {
self.power5
}
pub fn get_power7(&self) -> u32 {
self.power7
}
pub fn get_power11(&self) -> u32 {
self.power11
}
pub fn get_other_factors(&self) -> usize {
self.other_factors
}
pub fn product(&self) -> usize {
(self.other_factors
* 3usize.pow(self.power3)
* 5usize.pow(self.power5)
* 7usize.pow(self.power7)
* 11usize.pow(self.power11))
<< self.power2
}
pub fn product_power2power3(&self) -> usize {
3usize.pow(self.power3) << self.power2
}
#[allow(unused)]
pub fn divide_by(&self, divisor: &PartialFactors) -> Option<PartialFactors> {
let two_divides = self.power2 >= divisor.power2;
let three_divides = self.power3 >= divisor.power3;
let five_divides = self.power5 >= divisor.power5;
let seven_divides = self.power7 >= divisor.power7;
let eleven_divides = self.power11 >= divisor.power11;
let other_divides = self.other_factors % divisor.other_factors == 0;
if two_divides
&& three_divides
&& five_divides
&& seven_divides
&& eleven_divides
&& other_divides
{
Some(Self {
power2: self.power2 - divisor.power2,
power3: self.power3 - divisor.power3,
power5: self.power5 - divisor.power5,
power7: self.power7 - divisor.power7,
power11: self.power11 - divisor.power11,
other_factors: if self.other_factors == divisor.other_factors {
1
} else {
self.other_factors / divisor.other_factors
},
})
} else {
None
}
}
}
// cargo bench generate_raders_benchmarks -- --nocapture --ignored
#[ignore]
#[bench]
fn generate_raders_benchmarks(_: &mut test::Bencher) {
for len in 10usize..100000 {
if miller_rabin(len as u64) {
let inner_factors = PartialFactors::compute(len - 1);
if inner_factors.get_other_factors() == 1 && inner_factors.get_power11() > 0 {
println!("#[bench] fn comparef64_len{:07}_11p{:02}_bluesteins(b: &mut Bencher) {{ bench_planned_bluesteins_f64(b, {}); }}", len, inner_factors.get_power11(), len);
println!("#[bench] fn comparef64_len{:07}_11p{:02}_raders(b: &mut Bencher) {{ bench_planned_raders_f64(b, {}); }}", len, inner_factors.get_power11(), len);
}
}
}
}
fn wrap_fft<T: FftNum>(fft: impl Fft<T> + 'static) -> Arc<dyn Fft<T>> {
Arc::new(fft) as Arc<dyn Fft<T>>
}
// passes the given FFT length directly to the FFT planner
fn bench_planned_fft_f32(b: &mut Bencher, len: usize) {
let mut planner: FftPlanner<f32> = FftPlanner::new();
let fft = planner.plan_fft_forward(len);
let mut buffer = vec![Complex::zero(); fft.len()];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
// passes the given FFT length directly to the FFT planner
fn bench_planned_fft_f64(b: &mut Bencher, len: usize) {
let mut planner: FftPlanner<f64> = FftPlanner::new();
let fft = planner.plan_fft_forward(len);
let mut buffer = vec![Complex::zero(); fft.len()];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| {
fft.process_with_scratch(&mut buffer, &mut scratch);
});
}
/*
// Computes the given FFT length using Bluestein's Algorithm, using the planner to plan the inner FFT
fn bench_planned_bluesteins_f32(b: &mut Bencher, len: usize) {
let mut planner : FftPlannerAvx<f32> = FftPlannerAvx::new(false).unwrap();
let fft = planner.construct_bluesteins(len);
let mut buffer = vec![Complex::zero(); fft.len()];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| { fft.process_with_scratch(&mut buffer, &mut scratch); });
}
// Computes the given FFT length using Rader's Algorithm, using the planner to plan the inner FFT
fn bench_planned_raders_f32(b: &mut Bencher, len: usize) {
let mut planner : FftPlannerAvx<f32> = FftPlannerAvx::new(false).unwrap();
let fft = planner.construct_raders(len);
let mut buffer = vec![Complex::zero(); fft.len()];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| { fft.process_with_scratch(&mut buffer, &mut scratch); });
}
// Computes the given FFT length using Bluestein's Algorithm, using the planner to plan the inner FFT
fn bench_planned_bluesteins_f64(b: &mut Bencher, len: usize) {
let mut planner : FftPlannerAvx<f64> = FftPlannerAvx::new(false).unwrap();
let fft = planner.construct_bluesteins(len);
let mut buffer = vec![Complex::zero(); fft.len()];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| { fft.process_with_scratch(&mut buffer, &mut scratch); });
}
// Computes the given FFT length using Rader's Algorithm, using the planner to plan the inner FFT
fn bench_planned_raders_f64(b: &mut Bencher, len: usize) {
let mut planner : FftPlannerAvx<f64> = FftPlannerAvx::new(false).unwrap();
let fft = planner.construct_raders(len);
let mut buffer = vec![Complex::zero(); fft.len()];
let mut scratch = vec![Complex::zero(); fft.get_inplace_scratch_len()];
b.iter(|| { fft.process_with_scratch(&mut buffer, &mut scratch); });
}
#[bench] fn comparef64_len0000023_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 23); }
#[bench] fn comparef64_len0000023_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 23); }
#[bench] fn comparef64_len0000067_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 67); }
#[bench] fn comparef64_len0000067_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 67); }
#[bench] fn comparef64_len0000089_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 89); }
#[bench] fn comparef64_len0000089_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 89); }
#[bench] fn comparef64_len0000199_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 199); }
#[bench] fn comparef64_len0000199_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 199); }
#[bench] fn comparef64_len0000331_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 331); }
#[bench] fn comparef64_len0000331_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 331); }
#[bench] fn comparef64_len0000353_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 353); }
#[bench] fn comparef64_len0000353_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 353); }
#[bench] fn comparef64_len0000397_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 397); }
#[bench] fn comparef64_len0000397_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 397); }
#[bench] fn comparef64_len0000463_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 463); }
#[bench] fn comparef64_len0000463_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 463); }
#[bench] fn comparef64_len0000617_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 617); }
#[bench] fn comparef64_len0000617_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 617); }
#[bench] fn comparef64_len0000661_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 661); }
#[bench] fn comparef64_len0000661_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 661); }
#[bench] fn comparef64_len0000727_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 727); }
#[bench] fn comparef64_len0000727_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 727); }
#[bench] fn comparef64_len0000881_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 881); }
#[bench] fn comparef64_len0000881_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 881); }
#[bench] fn comparef64_len0000991_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 991); }
#[bench] fn comparef64_len0000991_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 991); }
#[bench] fn comparef64_len0001321_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 1321); }
#[bench] fn comparef64_len0001321_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 1321); }
#[bench] fn comparef64_len0001409_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 1409); }
#[bench] fn comparef64_len0001409_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 1409); }
#[bench] fn comparef64_len0001453_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 1453); }
#[bench] fn comparef64_len0001453_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 1453); }
#[bench] fn comparef64_len0001783_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 1783); }
#[bench] fn comparef64_len0001783_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 1783); }
#[bench] fn comparef64_len0002113_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 2113); }
#[bench] fn comparef64_len0002113_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 2113); }
#[bench] fn comparef64_len0002179_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 2179); }
#[bench] fn comparef64_len0002179_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 2179); }
#[bench] fn comparef64_len0002311_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 2311); }
#[bench] fn comparef64_len0002311_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 2311); }
#[bench] fn comparef64_len0002377_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 2377); }
#[bench] fn comparef64_len0002377_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 2377); }
#[bench] fn comparef64_len0002663_11p03_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 2663); }
#[bench] fn comparef64_len0002663_11p03_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 2663); }
#[bench] fn comparef64_len0002971_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 2971); }
#[bench] fn comparef64_len0002971_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 2971); }
#[bench] fn comparef64_len0003169_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 3169); }
#[bench] fn comparef64_len0003169_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 3169); }
#[bench] fn comparef64_len0003301_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 3301); }
#[bench] fn comparef64_len0003301_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 3301); }
#[bench] fn comparef64_len0003389_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 3389); }
#[bench] fn comparef64_len0003389_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 3389); }
#[bench] fn comparef64_len0003631_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 3631); }
#[bench] fn comparef64_len0003631_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 3631); }
#[bench] fn comparef64_len0003697_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 3697); }
#[bench] fn comparef64_len0003697_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 3697); }
#[bench] fn comparef64_len0003851_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 3851); }
#[bench] fn comparef64_len0003851_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 3851); }
#[bench] fn comparef64_len0004159_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 4159); }
#[bench] fn comparef64_len0004159_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 4159); }
#[bench] fn comparef64_len0004357_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 4357); }
#[bench] fn comparef64_len0004357_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 4357); }
#[bench] fn comparef64_len0004621_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 4621); }
#[bench] fn comparef64_len0004621_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 4621); }
#[bench] fn comparef64_len0004951_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 4951); }
#[bench] fn comparef64_len0004951_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 4951); }
#[bench] fn comparef64_len0005281_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 5281); }
#[bench] fn comparef64_len0005281_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 5281); }
#[bench] fn comparef64_len0005347_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 5347); }
#[bench] fn comparef64_len0005347_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 5347); }
#[bench] fn comparef64_len0005501_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 5501); }
#[bench] fn comparef64_len0005501_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 5501); }
#[bench] fn comparef64_len0006337_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 6337); }
#[bench] fn comparef64_len0006337_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 6337); }
#[bench] fn comparef64_len0006469_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 6469); }
#[bench] fn comparef64_len0006469_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 6469); }
#[bench] fn comparef64_len0007129_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 7129); }
#[bench] fn comparef64_len0007129_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 7129); }
#[bench] fn comparef64_len0007393_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 7393); }
#[bench] fn comparef64_len0007393_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 7393); }
#[bench] fn comparef64_len0007547_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 7547); }
#[bench] fn comparef64_len0007547_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 7547); }
#[bench] fn comparef64_len0008317_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 8317); }
#[bench] fn comparef64_len0008317_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 8317); }
#[bench] fn comparef64_len0008713_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 8713); }
#[bench] fn comparef64_len0008713_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 8713); }
#[bench] fn comparef64_len0009241_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 9241); }
#[bench] fn comparef64_len0009241_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 9241); }
#[bench] fn comparef64_len0009857_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 9857); }
#[bench] fn comparef64_len0009857_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 9857); }
#[bench] fn comparef64_len0009901_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 9901); }
#[bench] fn comparef64_len0009901_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 9901); }
#[bench] fn comparef64_len0010781_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 10781); }
#[bench] fn comparef64_len0010781_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 10781); }
#[bench] fn comparef64_len0010891_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 10891); }
#[bench] fn comparef64_len0010891_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 10891); }
#[bench] fn comparef64_len0011551_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 11551); }
#[bench] fn comparef64_len0011551_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 11551); }
#[bench] fn comparef64_len0011617_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 11617); }
#[bench] fn comparef64_len0011617_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 11617); }
#[bench] fn comparef64_len0012101_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 12101); }
#[bench] fn comparef64_len0012101_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 12101); }
#[bench] fn comparef64_len0013553_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 13553); }
#[bench] fn comparef64_len0013553_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 13553); }
#[bench] fn comparef64_len0013751_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 13751); }
#[bench] fn comparef64_len0013751_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 13751); }
#[bench] fn comparef64_len0014081_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 14081); }
#[bench] fn comparef64_len0014081_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 14081); }
#[bench] fn comparef64_len0014851_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 14851); }
#[bench] fn comparef64_len0014851_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 14851); }
#[bench] fn comparef64_len0015401_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 15401); }
#[bench] fn comparef64_len0015401_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 15401); }
#[bench] fn comparef64_len0015973_11p03_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 15973); }
#[bench] fn comparef64_len0015973_11p03_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 15973); }
#[bench] fn comparef64_len0016633_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 16633); }
#[bench] fn comparef64_len0016633_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 16633); }
#[bench] fn comparef64_len0018481_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 18481); }
#[bench] fn comparef64_len0018481_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 18481); }
#[bench] fn comparef64_len0019009_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 19009); }
#[bench] fn comparef64_len0019009_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 19009); }
#[bench] fn comparef64_len0019603_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 19603); }
#[bench] fn comparef64_len0019603_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 19603); }
#[bench] fn comparef64_len0019801_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 19801); }
#[bench] fn comparef64_len0019801_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 19801); }
#[bench] fn comparef64_len0021121_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 21121); }
#[bench] fn comparef64_len0021121_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 21121); }
#[bench] fn comparef64_len0022639_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 22639); }
#[bench] fn comparef64_len0022639_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 22639); }
#[bench] fn comparef64_len0023761_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 23761); }
#[bench] fn comparef64_len0023761_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 23761); }
#[bench] fn comparef64_len0025411_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 25411); }
#[bench] fn comparef64_len0025411_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 25411); }
#[bench] fn comparef64_len0025873_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 25873); }
#[bench] fn comparef64_len0025873_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 25873); }
#[bench] fn comparef64_len0026731_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 26731); }
#[bench] fn comparef64_len0026731_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 26731); }
#[bench] fn comparef64_len0026951_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 26951); }
#[bench] fn comparef64_len0026951_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 26951); }
#[bench] fn comparef64_len0028513_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 28513); }
#[bench] fn comparef64_len0028513_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 28513); }
#[bench] fn comparef64_len0029569_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 29569); }
#[bench] fn comparef64_len0029569_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 29569); }
#[bench] fn comparef64_len0030493_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 30493); }
#[bench] fn comparef64_len0030493_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 30493); }
#[bench] fn comparef64_len0030977_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 30977); }
#[bench] fn comparef64_len0030977_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 30977); }
#[bench] fn comparef64_len0032077_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 32077); }
#[bench] fn comparef64_len0032077_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 32077); }
#[bench] fn comparef64_len0032341_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 32341); }
#[bench] fn comparef64_len0032341_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 32341); }
#[bench] fn comparef64_len0034651_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 34651); }
#[bench] fn comparef64_len0034651_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 34651); }
#[bench] fn comparef64_len0034849_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 34849); }
#[bench] fn comparef64_len0034849_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 34849); }
#[bench] fn comparef64_len0035201_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 35201); }
#[bench] fn comparef64_len0035201_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 35201); }
#[bench] fn comparef64_len0037423_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 37423); }
#[bench] fn comparef64_len0037423_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 37423); }
#[bench] fn comparef64_len0038501_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 38501); }
#[bench] fn comparef64_len0038501_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 38501); }
#[bench] fn comparef64_len0047521_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 47521); }
#[bench] fn comparef64_len0047521_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 47521); }
#[bench] fn comparef64_len0047917_11p03_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 47917); }
#[bench] fn comparef64_len0047917_11p03_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 47917); }
#[bench] fn comparef64_len0050821_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 50821); }
#[bench] fn comparef64_len0050821_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 50821); }
#[bench] fn comparef64_len0055001_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 55001); }
#[bench] fn comparef64_len0055001_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 55001); }
#[bench] fn comparef64_len0055441_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 55441); }
#[bench] fn comparef64_len0055441_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 55441); }
#[bench] fn comparef64_len0055903_11p03_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 55903); }
#[bench] fn comparef64_len0055903_11p03_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 55903); }
#[bench] fn comparef64_len0057751_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 57751); }
#[bench] fn comparef64_len0057751_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 57751); }
#[bench] fn comparef64_len0063361_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 63361); }
#[bench] fn comparef64_len0063361_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 63361); }
#[bench] fn comparef64_len0064153_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 64153); }
#[bench] fn comparef64_len0064153_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 64153); }
#[bench] fn comparef64_len0066529_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 66529); }
#[bench] fn comparef64_len0066529_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 66529); }
#[bench] fn comparef64_len0068993_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 68993); }
#[bench] fn comparef64_len0068993_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 68993); }
#[bench] fn comparef64_len0069697_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 69697); }
#[bench] fn comparef64_len0069697_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 69697); }
#[bench] fn comparef64_len0076231_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 76231); }
#[bench] fn comparef64_len0076231_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 76231); }
#[bench] fn comparef64_len0077617_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 77617); }
#[bench] fn comparef64_len0077617_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 77617); }
#[bench] fn comparef64_len0079201_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 79201); }
#[bench] fn comparef64_len0079201_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 79201); }
#[bench] fn comparef64_len0079861_11p03_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 79861); }
#[bench] fn comparef64_len0079861_11p03_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 79861); }
#[bench] fn comparef64_len0080191_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 80191); }
#[bench] fn comparef64_len0080191_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 80191); }
#[bench] fn comparef64_len0084481_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 84481); }
#[bench] fn comparef64_len0084481_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 84481); }
#[bench] fn comparef64_len0084701_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 84701); }
#[bench] fn comparef64_len0084701_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 84701); }
#[bench] fn comparef64_len0087121_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 87121); }
#[bench] fn comparef64_len0087121_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 87121); }
#[bench] fn comparef64_len0088001_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 88001); }
#[bench] fn comparef64_len0088001_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 88001); }
#[bench] fn comparef64_len0089101_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 89101); }
#[bench] fn comparef64_len0089101_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 89101); }
#[bench] fn comparef64_len0092401_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 92401); }
#[bench] fn comparef64_len0092401_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 92401); }
#[bench] fn comparef64_len0097021_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 97021); }
#[bench] fn comparef64_len0097021_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 97021); }
#[bench] fn comparef64_len0098011_11p02_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 98011); }
#[bench] fn comparef64_len0098011_11p02_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 98011); }
#[bench] fn comparef64_len0098561_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 98561); }
#[bench] fn comparef64_len0098561_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 98561); }
#[bench] fn comparef64_len0099793_11p01_bluesteins(b: &mut Bencher) { bench_planned_bluesteins_f64(b, 99793); }
#[bench] fn comparef64_len0099793_11p01_raders(b: &mut Bencher) { bench_planned_raders_f64(b, 99793); }
*/