"Source: Text/System/Par.text";
"Line: 993";
"Date: Thu Jul 13 10:19:10 2023";
"Main: Fri Sep 26 14:29:19 2025";
// original file: Text/System/Par.text, line: 993
// Example: H5E8 ()
print "Example: H5E8";
ei := GetEchoInput();
SetEchoInput(true);
SetParallelFFT(true);
SetMemoryLimit(16*2^30);
Z := IntegerRing();
P<z> := PolynomialRing(Z);
range := [12 .. 18]; SCALE := 8; Time := Realtime;
range := [12 .. 16]; SCALE := 8; Time := Realtime;
for b in range do
    n := 2^b;
    nb := Round(n / SCALE); R := IntegerRing(2^nb);
    F := P![Z!Random(R): i in [1 .. n]];
    G := P![Z!Random(R): i in [1 .. n]];
    SetNthreads(1); T1 := Time(); p1 := F*G; T1 := Time(T1);
    SetNthreads(16); T16 := Time(); p2 := F*G; T16 := Time(T16);
    assert p1 eq p2;
    printf
       "n: %o; #bits: %o, 1T time: %.2o, 16T time: %.1o, speedup: %.1o\n",
        n, nb, T1, T16, T1/T16;
end for;
SetEchoInput(ei);
