Add rec1of1 and rec2of2 benchmarks for first parity reconstruction

This commit is contained in:
Andrea Mazzoleni 2026-08-20 17:50:49 +02:00
parent 354ab6f866
commit 831bbe7c1b
2 changed files with 370 additions and 23 deletions

View file

@ -198,7 +198,7 @@ void speed_gen(int nd, void** v, int size, int delta, int period, const char* ms
int mode = raid_mode(RAID_MODE_GET);
/* RAID table */
printf("RAID functions used for computing the parity with 'sync'%s:\n", msg);
printf("%s functions used for computing parity with 'sync':\n", msg);
printf("%8s", "");
printf("%8s", "best");
printf("%8s", "int8");
@ -1003,7 +1003,7 @@ void speed_genz(int nd, void** v, int size, int delta, int period)
int count;
/* Vandermonde table */
printf("Vandermonde RAID functions used for computing the parity with 'sync':\n");
printf("Vandermonde functions used for computing parity with 'sync':\n");
printf("%8s", "");
printf("%8s", "best");
printf("%8s", "int8");
@ -1123,7 +1123,7 @@ void speed_rec(int nd, void** v, int size, int delta, int period)
}
/* recover table */
printf("RAID functions used for recovering with 'fix':\n");
printf("RAID polynomial functions used for recovering with 'fix':\n");
printf("%8s", "");
printf("%8s", "best");
printf("%8s", "int8");
@ -1146,7 +1146,89 @@ void speed_rec(int nd, void** v, int size, int delta, int period)
#endif
printf("\n");
printf("%8s", "rec1");
/* REC1OF1 */
printf("%8s", "rec1of1");
printf("%8s", raid_rec_tag(RAID_ALGO_CAUCHY_PAR1));
fflush(stdout);
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_force(1, sizeof(void*) == 8 ? raid_gen1_int64 : raid_gen1_int32);
raid_rec1_int8(1, id, ip, nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
fflush(stdout);
#ifdef CONFIG_NEON
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_force(1, raid_gen1_neon);
raid_rec1_neon(1, id, ip, nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
fflush(stdout);
#endif
#ifdef CONFIG_X86
if (raid_cpu_has_ssse3()) {
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_force(1, raid_gen1_sse2);
raid_rec1_ssse3(1, id, ip, nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
fflush(stdout);
}
if (raid_cpu_has_avx2()) {
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_force(1, raid_gen1_avx2);
raid_rec1_avx2(1, id, ip, nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
fflush(stdout);
}
#ifdef CONFIG_X86_64
if (raid_cpu_has_avx512bw()) {
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_force(1, raid_gen1_avx512bw);
raid_rec1_avx512bw(1, id, ip, nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
fflush(stdout);
}
if (raid_cpu_has_avx2gfni()) {
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_force(1, raid_gen1_avx2);
raid_rec1_avx2gfni_raid(1, id, ip, nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
fflush(stdout);
}
if (raid_cpu_has_avx512gfni()) {
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_force(1, raid_gen1_avx512bw); /* there is no raid_gen1_avx512gfni */
raid_rec1_avx512gfni_raid(1, id, ip, nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
fflush(stdout);
}
#endif
#endif
printf("\n");
/* REC1OF2 */
printf("%8s", "rec1of2");
printf("%8s", raid_rec_tag(RAID_ALGO_CAUCHY_PAR1));
fflush(stdout);
@ -1233,7 +1315,97 @@ void speed_rec(int nd, void** v, int size, int delta, int period)
#endif
printf("\n");
printf("%8s", "rec2");
/* REC2OF2 */
printf("%8s", "rec2of2");
printf("%8s", raid_rec_tag(RAID_ALGO_CAUCHY_PAR2));
fflush(stdout);
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_force(2, sizeof(void*) == 8 ? raid_gen2_int64_raid : raid_gen2_int32_raid);
raid_rec2_int8(2, id, ip, nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
fflush(stdout);
#ifdef CONFIG_NEON
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_force(2, raid_gen2_neon_raid);
raid_rec2_neon(2, id, ip, nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
fflush(stdout);
#endif
#ifdef CONFIG_X86
if (raid_cpu_has_ssse3()) {
SPEED_START {
/* ensure to use same hardware in the delta step */
#ifdef CONFIG_X86_64
raid_gen_force(2, raid_gen2_sse2ext_raid);
#else
raid_gen_force(2, raid_gen2_sse2_raid);
#endif
raid_rec2_ssse3(2, id, ip, nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
fflush(stdout);
}
if (raid_cpu_has_avx2()) {
SPEED_START {
/* ensure to use same hardware in the delta step */
#ifdef CONFIG_X86_64
raid_gen_force(2, raid_gen2_avx2ext_raid);
#else
raid_gen_force(2, raid_gen2_avx2_raid);
#endif
raid_rec2_avx2(2, id, ip, nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
fflush(stdout);
}
#ifdef CONFIG_X86_64
if (raid_cpu_has_avx512bw()) {
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_force(2, raid_gen2_avx512bw);
raid_rec2_avx512bw(2, id, ip, nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
fflush(stdout);
}
if (raid_cpu_has_avx2gfni()) {
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_force(2, raid_gen2_avx2gfni_raid);
raid_rec2_avx2gfni_raid(2, id, ip, nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
fflush(stdout);
}
if (raid_cpu_has_avx512gfni()) {
SPEED_START {
/* ensure to use same hardware in the delta step */
raid_gen_force(2, raid_gen2_avx512gfni_raid);
raid_rec2_avx512gfni_raid(2, id, ip, nd, size, v);
} SPEED_STOP
printf("%8" PRIu64, ds / dt);
fflush(stdout);
}
#endif
#endif
printf("\n");
/* REC2OF3 */
printf("%8s", "rec2of3");
printf("%8s", raid_rec_tag(RAID_ALGO_CAUCHY_PAR2));
fflush(stdout);
@ -1328,7 +1500,7 @@ void speed_rec(int nd, void** v, int size, int delta, int period)
#endif
printf("\n");
printf("%8s", "rec3");
printf("%8s", "rec3of3");
printf("%8s", raid_rec_tag(RAID_ALGO_CAUCHY_PAR3));
fflush(stdout);
@ -1417,7 +1589,7 @@ void speed_rec(int nd, void** v, int size, int delta, int period)
#endif
printf("\n");
printf("%8s", "rec4");
printf("%8s", "rec4of4");
printf("%8s", raid_rec_tag(RAID_ALGO_CAUCHY_PAR4));
fflush(stdout);
@ -1507,7 +1679,7 @@ void speed_rec(int nd, void** v, int size, int delta, int period)
#endif
printf("\n");
printf("%8s", "rec5");
printf("%8s", "rec5of5");
printf("%8s", raid_rec_tag(RAID_ALGO_CAUCHY_PAR5));
fflush(stdout);
@ -1596,7 +1768,7 @@ void speed_rec(int nd, void** v, int size, int delta, int period)
#endif
printf("\n");
printf("%8s", "rec6");
printf("%8s", "rec6of6");
printf("%8s", raid_rec_tag(RAID_ALGO_CAUCHY_PAR6));
fflush(stdout);
@ -1685,6 +1857,9 @@ void speed_rec(int nd, void** v, int size, int delta, int period)
#endif
printf("\n");
printf("\n");
printf("(recNofM: N data disks recovered using parities up to the M-th parity,\n");
printf(" e.g. rec1of1 uses P, rec1of2 uses Q, rec2of2 uses P+Q, rec2of3 uses Q+R)\n");
printf("\n");
}
void speed_affinity(void)
@ -1921,10 +2096,10 @@ void speed(int period, int nd, int size)
speed_hash(nd, v, size, delta, period);
raid_mode(RAID_MODE_CAUCHY_RAID);
speed_gen(nd, v, size, delta, period, " (RAID polynomial)");
speed_gen(nd, v, size, delta, period, "RAID polynomial");
raid_mode(RAID_MODE_CAUCHY_AES);
speed_gen(nd, v, size, delta, period, " (AES polynomial)");
speed_gen(nd, v, size, delta, period, "AES polynomial");
raid_mode(RAID_MODE_CAUCHY_RAID);
speed_genz(nd, v, size, delta, period);