Re: Default initialization of static array faster than void initialization

2019-11-08 Thread kinke via Digitalmars-d-learn
On Friday, 8 November 2019 at 16:49:37 UTC, wolframw wrote: I compiled with dmd -O -inline -release -noboundscheck -mcpu=avx2 and ran the tests with the m array being default-initialized in one run and void-initialized in another run. The results: Default-initialized: 245 ms, 495 μs, and 2 hns

Re: Default initialization of static array faster than void initialization

2019-11-08 Thread Ali Çehreli via Digitalmars-d-learn
One correction: I think you mean "using" a default-initialized array is faster (not the initialization itself). Another observation: dmd -O makes both cases slower! Hm? Ali

Default initialization of static array faster than void initialization

2019-11-08 Thread wolframw via Digitalmars-d-learn
Hi, Chapter 12.15.2 of the spec explains that void initialization of a static array can be faster than default initialization. This seems logical because the array entries don't need to be set to NaN. However, when I ran some tests for my matrix implementation, it seemed that the default-init