Need for speed

Ali Çehreli acehreli at yahoo.com
Thu Apr 1 17:25:44 UTC 2021


On 4/1/21 10:15 AM, ag0aep6g wrote:

 > Move `auto rnd = ...;` out of the loop, and you will get better times.

Doing that reduces the time about 15 fold.

Using Appender reduces it further a tiny bit:

import std.array;
// ...
     Appender!(int[]) mylist;
// ...
     mylist.data.sort();

Ali



More information about the Digitalmars-d-learn mailing list