D for the Win

ketmar via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Sun Aug 24 07:04:10 PDT 2014


On Sun, 24 Aug 2014 13:44:07 +0000
Mike via Digitalmars-d-announce <digitalmars-d-announce at puremagic.com>
wrote:

p.s. what i did is this:

  auto tm = Timer();
  tm.start;
  foreach (; 0..100) {
    auto n2d = Noise2DContext(0);
    foreach (i; 0..100) {
      foreach (y; 0..256) {
        foreach (x; 0..256) {
          auto v = n2d.get(x * 0.1f, y * 0.1f) *
            0.5f + 0.5f;
          pixels[y*256+x] = v;
        }
      }
    }
  }
  tm.stop;
  writeln(tm.toString);

Timer is my simple timer class which uses MonoTime to measure intervals.
this shows ~22 seconds for both variants, with #6 and without #6.

and 57 seconds for variants without sse3 flags. ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-announce/attachments/20140824/0c166626/attachment.sig>


More information about the Digitalmars-d-announce mailing list