X-Git-Url: https://git.llucax.com/software/dgc/dgcbench.git/blobdiff_plain/254a2ba31ffdfd67235959c657551e029df4fab5..32e30dccf780043b8459855864b59961a740f9a0:/micro/rnd_data_2.d diff --git a/micro/rnd_data_2.d b/micro/rnd_data_2.d index ee76cf1..1cd89bf 100644 --- a/micro/rnd_data_2.d +++ b/micro/rnd_data_2.d @@ -4,23 +4,25 @@ // (changed not to print anything and lower the total iterations; ported to // Tango) -import tango.core.Memory; +// Total residency should be ~160 MiB, but it usually increases a lot because +// of false positives (probably in the static memory area) + import tango.math.random.Random; +const N = 2_000_000; +const L = 20; +const I = 50; // original: 200 + int main(char[][] args) { int[][] stuff; - int NUM = 2_000_000; - - stuff.length = 20; - - GC.disable(); + stuff.length = L; auto rand = new Random(); - for(int i = 0; i < 200; i++) { - int[] arr = new int[NUM]; + for(int i = 0; i < I; i++) { + int[] arr = new int[N]; for(int j = 0; j < arr.length; j++) { rand(arr[j]); @@ -31,10 +33,6 @@ int main(char[][] args) zig = rand.uniform!(int) % stuff.length; stuff[zig] = arr; - - if (i == 20) { - GC.enable(); - } } return 0;