On 3/24/22 07:54, Mike Parker wrote:

The blog:
https://dlang.org/blog/2022/03/24/reducing-template-compile-times/

There is an opportunity for a minor optimization where the following code is introduced in the article.

To reduce code compiled for the non-unittest binary, I sometimes define types and import declarations needed only by unittests, inside version(unittest) blocks:

version (unittest) {        // <-- ADDED

import some_unittest_utils; // <-- Added example

struct JustInt
{
  int x;
}

}                           // <-- ADDED

static foreach(_; 0..5)
{
  unittest
  {
    JustInt value;
    value.send;
  }
}

Ali

Reply via email to