1 // Written by Oskar Linde <oskar.lindeREM@OVEgmail.com>
2 // Found at http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=46407
3 // Sightly modified by Leandro Lucarella <llucax@gmail.com>
4 // (changed the main loop not to be endless and ported to Tango)
6 import tango.math.random.Random;
8 const IT = 125; // number of iterations, each creates an object
9 const BYTES = 1_000_000; // ~1MiB per object
10 const N = 50; // ~50MiB of initial objects
14 C c; // makes the compiler not set NO_SCAN
15 long[BYTES/long.sizeof] data;
19 auto rand = new Random();
22 foreach (ref o; objs) {
24 foreach (ref x; o.data)
27 for (int i = 0; i < IT; ++i) {
29 foreach (ref x; o.data)
31 // do something with the data...